comparison lisp/calendar/cal-hebrew.el @ 93409:b705f66a40fc

(holiday-hebrew): Simplify.
author Glenn Morris <rgm@gnu.org>
date Sat, 29 Mar 2008 23:23:20 +0000
parents 5fce742bc681
children 9d52e0832665
comparison
equal deleted inserted replaced
93408:e4579b12c537 93409:b705f66a40fc
282 (if (< 11 month) (- month 11) (+ month 1)) 282 (if (< 11 month) (- month 11) (+ month 1))
283 (if (< 10 month) (- month 10) (+ month 2)) 283 (if (< 10 month) (- month 10) (+ month 2))
284 (if (< 9 month) (- month 9) (+ month 3)) 284 (if (< 9 month) (- month 9) (+ month 3))
285 (if (< 8 month) (- month 8) (+ month 4)) 285 (if (< 8 month) (- month 8) (+ month 4))
286 (if (< 7 month) (- month 7) (+ month 5)))) 286 (if (< 7 month) (- month 7) (+ month 5))))
287 (let ((m1 displayed-month) 287 (let* ((m1 displayed-month)
288 (y1 displayed-year) 288 (y1 displayed-year)
289 (m2 displayed-month) 289 (m2 displayed-month)
290 (y2 displayed-year) 290 (y2 displayed-year)
291 (year)) 291 (start-date (progn
292 (increment-calendar-month m1 y1 -1) 292 (increment-calendar-month m1 y1 -1)
293 (increment-calendar-month m2 y2 1) 293 (calendar-absolute-from-gregorian (list m1 1 y1))))
294 (let* ((start-date (calendar-absolute-from-gregorian 294 (end-date (progn
295 (list m1 1 y1))) 295 (increment-calendar-month m2 y2 1)
296 (end-date (calendar-absolute-from-gregorian 296 (calendar-absolute-from-gregorian
297 (list m2 (calendar-last-day-of-month m2 y2) y2))) 297 (list m2 (calendar-last-day-of-month m2 y2) y2))))
298 (hebrew-start (calendar-hebrew-from-absolute start-date)) 298 (hebrew-start (calendar-hebrew-from-absolute start-date))
299 (hebrew-end (calendar-hebrew-from-absolute end-date)) 299 (hebrew-end (calendar-hebrew-from-absolute end-date))
300 (hebrew-y1 (extract-calendar-year hebrew-start)) 300 (hebrew-y1 (extract-calendar-year hebrew-start))
301 (hebrew-y2 (extract-calendar-year hebrew-end))) 301 (hebrew-y2 (extract-calendar-year hebrew-end))
302 (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) 302 (year (if (< 6 month) hebrew-y2 hebrew-y1))
303 (let ((date (calendar-gregorian-from-absolute 303 (date (calendar-gregorian-from-absolute
304 (calendar-absolute-from-hebrew 304 (calendar-absolute-from-hebrew (list month day year)))))
305 (list month day year))))) 305 (if (calendar-date-is-visible-p date)
306 (if (calendar-date-is-visible-p date) 306 (list (list date string))))))
307 (list (list date string))))))))
308 307
309 ;; h-r-h-e should be called from holidays code. 308 ;; h-r-h-e should be called from holidays code.
310 (declare-function holiday-filter-visible-calendar "holidays" (l)) 309 (declare-function holiday-filter-visible-calendar "holidays" (l))
311 310
312 ;;;###holiday-autoload 311 ;;;###holiday-autoload