;ELC   
;;; Compiled by kwzh@mescaline.gnu.org on Sat Jun 20 19:53:16 1998
;;; from file /gnu/gd/gd/1/gnu/emacs/lisp/calendar/cal-iso.el
;;; in Emacs version 20.2.96.1
;;; with bytecomp version 2.46
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`cal-iso.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'calendar)
#@503 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.
(defalias 'calendar-absolute-from-iso #[(date) "\211@)\211A@)\211AA@)\306\307\211\211E\211\211AA@)S\211\211@)\211A@)\211AA@)\nS\310_\\\311V\203w \312_\313\\\314\245Z\211\312\246\315U\205n \316\246\315U?\206n \317\246\315U)\203w T-\f\320_\\\f\312\245\\\f\316\245[\\\f\317\245\\*\321\\\"	S\322_\\\n\315U\203\236 \323\202\240 \nS\\+\207" [date week day year prior-years month calendar-dayname-on-or-before 1 31 2 4 23 10 0 100 400 365 3 7 6 day-of-year] 8 (#$ . 640)])
#@549 Compute the `ISO commercial date' corresponding to the absolute 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
absolute date is the number of days elapsed since the (imaginary) Gregorian
date Sunday, December 31, 1 BC.
(defalias 'calendar-iso-from-absolute #[(date) "\305\306Z!\211AA@)\211\211\307\310\311\211TE!Y\203& \nTT\202 \n*\\\310\311\211\fE!Z\312\245T\312\246\fE*\207" [date approx sum y year calendar-gregorian-from-absolute 3 0 calendar-absolute-from-iso 1 7] 7 (#$ . 1657)])
#@86 String of ISO date of Gregorian DATE.
Defaults to today's date if DATE is not given.
(defalias 'calendar-iso-date-string #[(&optional date) "\206 \306 \211\211AA@)S\211\211@)\211A@)\211AA@)\nS\307_\\\n\310V\203] \n\311_\312\\\313\245Z\f\211\311\246\314U\205V \f\315\246\314U?\206V \f\316\246\314U)\203] T-	\317_\\	\311\245\\	\315\245[\\	\316\245\\*\211\320\246\321!\322\323\314U\203\211 \320\202\212 \211@)\211AA@)$+\207" [date prior-years month day year day-of-year calendar-current-date 31 2 4 23 10 0 100 400 365 7 calendar-iso-from-absolute format "Day %s of week %d of %d" d iso-date] 6 (#$ . 2492)])
#@57 Show equivalent ISO date for the date under the cursor.
(defalias 'calendar-print-iso-date #[nil "\300\301\302\303\304!!\"\207" [message "ISO date: %s" calendar-iso-date-string calendar-cursor-to-date t] 5 (#$ . 3142) nil])
#@60 Move cursor to ISO DATE; echo ISO date unless NOECHO is t.
(defalias 'calendar-goto-iso-date #[(date &optional noecho) "\302\303\304!!!\210	\206 \305 \207" [date noecho calendar-goto-date calendar-gregorian-from-absolute calendar-absolute-from-iso calendar-print-iso-date] 4 (#$ . 3372) (let* ((today (calendar-current-date)) (year (calendar-read "ISO calendar year (>0): " '(lambda (x) (> x 0)) (int-to-string (extract-calendar-year today)))) (no-weeks (extract-calendar-month (calendar-iso-from-absolute (1- (calendar-dayname-on-or-before 1 (calendar-absolute-from-gregorian (list 1 4 (1+ year)))))))) (week (calendar-read (format "ISO calendar week (1-%d): " no-weeks) '(lambda (x) (and (> x 0) (<= x no-weeks))))) (day (calendar-read "ISO day (1-7): " '(lambda (x) (and (<= 1 x) (<= x 7)))))) (list (list week day year)))])
#@46 ISO calendar equivalent of date diary entry.
(defalias 'diary-iso-date #[nil "\301\302\303!\"\207" [date format "ISO date: %s" calendar-iso-date-string] 4 (#$ . 4208)])
(provide 'cal-iso)
