Function: calendar-iso-to-absolute
calendar-iso-to-absolute is a byte-compiled function defined in
cal-iso.el.gz.
Signature
(calendar-iso-to-absolute DATE)
Documentation
The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
The "ISO year" corresponds approximately to the Gregorian year, but
weeks start on Monday and end on Sunday. The first week of the ISO year is
the first such week in which at least 4 days are in a year. The ISO
commercial DATE has the form (week day year) in which week is in the range
1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 =
Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-iso.el.gz
(defun calendar-iso-to-absolute (date)
"The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
The \"ISO year\" corresponds approximately to the Gregorian year, but
weeks start on Monday and end on Sunday. The first week of the ISO year is
the first such week in which at least 4 days are in a year. The ISO
commercial DATE has the form (week day year) in which week is in the range
1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 =
Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary."
(let ((day (calendar-extract-day date)))
(+ (calendar-dayname-on-or-before
1 (+ 3 (calendar-absolute-from-gregorian
(list 1 1 (calendar-extract-year date)))))
;; ISO date is (week day year); normally (month day year).
(* 7 (1- (calendar-extract-month date)))
(if (zerop day) 6 (1- day)))))