[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calendar m17n

From: Kevin Rodgers
Subject: Re: calendar m17n
Date: Thu, 14 Sep 2006 09:39:00 -0600
User-agent: Thunderbird (Windows/20060719)

Andreas Schwab wrote:
Andreas Roehler <address@hidden> writes:

It's just to find and pick the right one. Could someone
give me a hint, where to collect it respecting GPl

You could read it from the output of "locale day" and "locale mon".


Just curious: does format-time-string take into account the locale?
This is something I came up with a few years ago:

(defvar autocap-abbrev-months
  (let ((year (string-to-number (format-time-string "%Y"))))
    (apply 'nconc
           (mapcar (lambda (month)
                     (let ((first (encode-time 0 0 0 1 month year 0)))
                       (list (format-time-string "%b." first t)
                             (format-time-string "%B" first t))))
                   '(1 2 3 4 5 6 7 8 9 10 11 12))))
"The list of month names and abbreviations to be automatically capitalized.")

(defvar autocap-abbrev-days
  (let ((year (string-to-number (format-time-string "%Y")))
        (month (string-to-number (format-time-string "%m"))))
    (apply 'nconc
           (mapcar (lambda (time)
                     (list (format-time-string "%a." time)
                           (format-time-string "%A" time)))
                   (sort (mapcar (lambda (day)
                                   (encode-time 0 0 0 day month year 0))
                                 '(1 2 3 4 5 6 7))
                         ;; by day of week:
                         (lambda (time-1 time-2)
                           (< (nth 6 (decode-time time-1))
                              (nth 6 (decode-time time-2))))))))
"The list of day names and abbreviations to be automatically capitalized.")


reply via email to

[Prev in Thread] Current Thread [Next in Thread]