Mercurial > emacs
comparison lisp/calendar/calendar.el @ 94454:0246f8c8f19e
(calendar-nth-named-absday, calendar-nth-named-day): Doc fix.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Tue, 29 Apr 2008 03:34:17 +0000 |
parents | d550d8d3e7f3 |
children | e49abd957e81 |
comparison
equal
deleted
inserted
replaced
94453:b354d19386f9 | 94454:0246f8c8f19e |
---|---|
2127 absolute date d, applying it to d-1 gives the DAYNAME previous to absolute | 2127 absolute date d, applying it to d-1 gives the DAYNAME previous to absolute |
2128 date d, and applying it to d+7 gives the DAYNAME following absolute date d." | 2128 date d, and applying it to d+7 gives the DAYNAME following absolute date d." |
2129 (- date (% (- date dayname) 7))) | 2129 (- date (% (- date dayname) 7))) |
2130 | 2130 |
2131 (defun calendar-nth-named-absday (n dayname month year &optional day) | 2131 (defun calendar-nth-named-absday (n dayname month year &optional day) |
2132 "The absolute date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. | 2132 "Absolute date of the Nth DAYNAME after/before MONTH YEAR DAY. |
2133 A DAYNAME of 0 means Sunday, 1 means Monday, and so on. If N<0, | 2133 A DAYNAME of 0 means Sunday, 1 means Monday, and so on. |
2134 return the Nth DAYNAME before MONTH DAY, YEAR (inclusive). | |
2135 If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive). | 2134 If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive). |
2136 | 2135 If N<0, return the Nth DAYNAME before MONTH DAY, YEAR (inclusive). |
2137 If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." | 2136 DAY defaults to 1 if N>0, and MONTH's last day otherwise." |
2138 (if (> n 0) | 2137 (if (> n 0) |
2139 (+ (* 7 (1- n)) | 2138 (+ (* 7 (1- n)) |
2140 (calendar-dayname-on-or-before | 2139 (calendar-dayname-on-or-before |
2141 dayname | 2140 dayname |
2142 (+ 6 (calendar-absolute-from-gregorian | 2141 (+ 6 (calendar-absolute-from-gregorian |
2148 (list month | 2147 (list month |
2149 (or day (calendar-last-day-of-month month year)) | 2148 (or day (calendar-last-day-of-month month year)) |
2150 year)))))) | 2149 year)))))) |
2151 | 2150 |
2152 (defun calendar-nth-named-day (n dayname month year &optional day) | 2151 (defun calendar-nth-named-day (n dayname month year &optional day) |
2153 "The date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. | 2152 "Date of the Nth DAYNAME after/before MONTH YEAR DAY. |
2154 Like `calendar-nth-named-absday', but returns a Gregorian date." | 2153 Like `calendar-nth-named-absday', but returns a Gregorian date." |
2155 (calendar-gregorian-from-absolute | 2154 (calendar-gregorian-from-absolute |
2156 (calendar-nth-named-absday n dayname month year day))) | 2155 (calendar-nth-named-absday n dayname month year day))) |
2157 | 2156 |
2158 (defun calendar-day-of-year-string (&optional date) | 2157 (defun calendar-day-of-year-string (&optional date) |