Mercurial > emacs
comparison lisp/calendar/cal-french.el @ 93809:3ff2b47de8f2
Update for calendar.el name changes.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 07 Apr 2008 01:59:37 +0000 |
parents | 1eed5494bf3f |
children | bf9ef749c23e |
comparison
equal
deleted
inserted
replaced
93808:2c72483f42c9 | 93809:3ff2b47de8f2 |
---|---|
112 | 112 |
113 (defun calendar-french-to-absolute (date) | 113 (defun calendar-french-to-absolute (date) |
114 "Compute absolute date from French Revolutionary date DATE. | 114 "Compute absolute date from French Revolutionary date DATE. |
115 The absolute date is the number of days elapsed since the (imaginary) | 115 The absolute date is the number of days elapsed since the (imaginary) |
116 Gregorian date Sunday, December 31, 1 BC." | 116 Gregorian date Sunday, December 31, 1 BC." |
117 (let ((month (extract-calendar-month date)) | 117 (let ((month (calendar-extract-month date)) |
118 (day (extract-calendar-day date)) | 118 (day (calendar-extract-day date)) |
119 (year (extract-calendar-year date))) | 119 (year (calendar-extract-year date))) |
120 (+ (* 365 (1- year)) ; days in prior years | 120 (+ (* 365 (1- year)) ; days in prior years |
121 ;; Leap days in prior years. | 121 ;; Leap days in prior years. |
122 (if (< year 20) | 122 (if (< year 20) |
123 (/ year 4) ; actual and anticipated practice (years 3, 7, 11, 15) | 123 (/ year 4) ; actual and anticipated practice (years 3, 7, 11, 15) |
124 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion). | 124 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion). |
168 Returns the empty string if DATE is pre-French Revolutionary. | 168 Returns the empty string if DATE is pre-French Revolutionary. |
169 Defaults to today's date if DATE is not given." | 169 Defaults to today's date if DATE is not given." |
170 (let* ((french-date (calendar-french-from-absolute | 170 (let* ((french-date (calendar-french-from-absolute |
171 (calendar-absolute-from-gregorian | 171 (calendar-absolute-from-gregorian |
172 (or date (calendar-current-date))))) | 172 (or date (calendar-current-date))))) |
173 (y (extract-calendar-year french-date)) | 173 (y (calendar-extract-year french-date)) |
174 (m (extract-calendar-month french-date)) | 174 (m (calendar-extract-month french-date)) |
175 (d (extract-calendar-day french-date))) | 175 (d (calendar-extract-day french-date))) |
176 (cond | 176 (cond |
177 ((< y 1) "") | 177 ((< y 1) "") |
178 ((= m 13) (format (if (calendar-french-accents-p) | 178 ((= m 13) (format (if (calendar-french-accents-p) |
179 "Jour %s de l'Année %d de la Révolution" | 179 "Jour %s de l'Année %d de la Révolution" |
180 "Jour %s de l'Anne'e %d de la Re'volution") | 180 "Jour %s de l'Anne'e %d de la Re'volution") |
212 (if (calendar-french-accents-p) | 212 (if (calendar-french-accents-p) |
213 "Année de la Révolution (>0): " | 213 "Année de la Révolution (>0): " |
214 "Anne'e de la Re'volution (>0): ") | 214 "Anne'e de la Re'volution (>0): ") |
215 (lambda (x) (> x 0)) | 215 (lambda (x) (> x 0)) |
216 (int-to-string | 216 (int-to-string |
217 (extract-calendar-year | 217 (calendar-extract-year |
218 (calendar-french-from-absolute | 218 (calendar-french-from-absolute |
219 (calendar-absolute-from-gregorian | 219 (calendar-absolute-from-gregorian |
220 (calendar-current-date)))))))) | 220 (calendar-current-date)))))))) |
221 (month-list | 221 (month-list |
222 (mapcar 'list | 222 (mapcar 'list |