/[emacs]/emacs/lisp/calendar/calendar.el
ViewVC logotype

Diff of /emacs/lisp/calendar/calendar.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.165 by gm, Wed Mar 16 13:23:09 2005 UTC revision 1.166 by wl, Fri Mar 25 09:53:47 2005 UTC
# Line 2884  interpreted as BC; -1 being 1 BC, and so Line 2884  interpreted as BC; -1 being 1 BC, and so
2884    (redraw-calendar))    (redraw-calendar))
2885    
2886  (defun calendar-date-is-visible-p (date)  (defun calendar-date-is-visible-p (date)
2887    "Return t if DATE is legal and is visible in the calendar window."    "Return t if DATE is valid and is visible in the calendar window."
2888    (let ((gap (calendar-interval    (let ((gap (calendar-interval
2889                displayed-month displayed-year                displayed-month displayed-year
2890                (extract-calendar-month date) (extract-calendar-year date))))                (extract-calendar-month date) (extract-calendar-year date))))
2891      (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap))))      (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap))))
2892    
2893  (defun calendar-date-is-legal-p (date)  (defun calendar-date-is-legal-p (date)
2894    "Return t if DATE is a legal date."    "Return t if DATE is a valid date."
2895    (let ((month (extract-calendar-month date))    (let ((month (extract-calendar-month date))
2896          (day (extract-calendar-day date))          (day (extract-calendar-day date))
2897          (year (extract-calendar-year date)))          (year (extract-calendar-year date)))
2898      (and (<= 1 month) (<= month 12)      (and (<= 1 month) (<= month 12)
2899           (<= 1 day) (<= day (calendar-last-day-of-month month year))           (<= 1 day) (<= day (calendar-last-day-of-month month year))
2900           ;; BC dates left as non-legal, to suppress errors from           ;; BC dates left as non-valid, to suppress errors from
2901           ;; complex holiday algorithms not suitable for years BC.           ;; complex holiday algorithms not suitable for years BC.
2902           ;; Note there are side effects on calendar navigation.           ;; Note there are side effects on calendar navigation.
2903           (<= 1 year))))           (<= 1 year))))

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26