annotate lisp/calendar/cal-iso.el @ 92986:589bafdc6c3e

Craig Markwardt <Craig.Markwardt at nasa.gov> (icalendar-recurring-start-year): New variable. (icalendar--diarytime-to-isotime): Fix treatment of 12:00pm - 12:59pm. (icalendar-export-region): Ignore hidden diary entries. (icalendar--convert-ordinary-to-ical): Fix case where event spans across midnight boundary. (icalendar-first-weekday-of-year): New function. (icalendar--convert-weekly-to-ical): Allow user-selectable start year for recurring events (Mozilla calendars do not propagate recurring events forever, so year 2000 start date was not working). (icalendar--convert-yearly-to-ical): Remove extra spaces in formatting of BYMONTH and BYMONTHDAY (not allowed by ical spec).
author Glenn Morris <rgm@gnu.org>
date Sun, 16 Mar 2008 01:21:25 +0000
parents d77fc175bcfc
children 5a7437fafea3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 20462
diff changeset
1 ;;; cal-iso.el --- calendar functions for the ISO calendar
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
2
92609
733bd38ed2dd Comments.
Glenn Morris <rgm@gnu.org>
parents: 92586
diff changeset
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
733bd38ed2dd Comments.
Glenn Morris <rgm@gnu.org>
parents: 92586
diff changeset
4 ;; 2008 Free Software Foundation, Inc.
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
5
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
65919
5c09efcfc1d9 Update maintainer email address.
Glenn Morris <rgm@gnu.org>
parents: 65145
diff changeset
7 ;; Maintainer: Glenn Morris <rgm@gnu.org>
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
8 ;; Keywords: calendar
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9 ;; Human-Keywords: ISO calendar, calendar, diary
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
78216
93e11478c954 Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 77279
diff changeset
15 ;; the Free Software Foundation; either version 3, or (at your option)
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
16 ;; any later version.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
17
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21 ;; GNU General Public License for more details.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13053
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61148
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61148
diff changeset
26 ;; Boston, MA 02110-1301, USA.
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28 ;;; Commentary:
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
29
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
30 ;; This collection of functions implements the features of calendar.el and
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
31 ;; diary.el that deal with the ISO calendar.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
32
20462
d179de7ad92e Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents: 14169
diff changeset
33 ;; Technical details of all the calendrical calculations can be found in
61148
7f7db25577d9 Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents: 57324
diff changeset
34 ;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
7f7db25577d9 Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents: 57324
diff changeset
35 ;; and Nachum Dershowitz, Cambridge University Press (2001).
20462
d179de7ad92e Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents: 14169
diff changeset
36
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
37 ;;; Code:
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
38
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
39 (require 'calendar)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
40
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
41 (defun calendar-absolute-from-iso (date)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
42 "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
43 The `ISO year' corresponds approximately to the Gregorian year, but
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
44 weeks start on Monday and end on Sunday. The first week of the ISO year is
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
45 the first such week in which at least 4 days are in a year. The ISO
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
46 commercial DATE has the form (week day year) in which week is in the range
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
47 1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 =
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
48 Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary."
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
49 (let ((day (extract-calendar-day date)))
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
50 (+ (calendar-dayname-on-or-before
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
51 1 (+ 3 (calendar-absolute-from-gregorian
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
52 (list 1 1 (extract-calendar-year date)))))
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
53 ;; ISO date is (week day year); normally (month day year).
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
54 (* 7 (1- (extract-calendar-month date)))
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
55 (if (zerop day) 6 (1- day)))))
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
56
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57 (defun calendar-iso-from-absolute (date)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
58 "Compute the `ISO commercial date' corresponding to the absolute DATE.
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
59 The ISO year corresponds approximately to the Gregorian year, but weeks
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60 start on Monday and end on Sunday. The first week of the ISO year is the
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
61 first such week in which at least 4 days are in a year. The ISO commercial
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
62 date has the form (week day year) in which week is in the range 1..52 and
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
63 day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 = Sunday). The
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64 absolute date is the number of days elapsed since the (imaginary) Gregorian
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
65 date Sunday, December 31, 1 BC."
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
66 (let* ((approx (extract-calendar-year
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
67 (calendar-gregorian-from-absolute (- date 3))))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
68 (year (+ approx
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
69 (calendar-sum y approx
92902
d77fc175bcfc Re-indent.
Glenn Morris <rgm@gnu.org>
parents: 92833
diff changeset
70 (>= date (calendar-absolute-from-iso
d77fc175bcfc Re-indent.
Glenn Morris <rgm@gnu.org>
parents: 92833
diff changeset
71 (list 1 1 (1+ y))))
d77fc175bcfc Re-indent.
Glenn Morris <rgm@gnu.org>
parents: 92833
diff changeset
72 1))))
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
73 (list
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
74 (1+ (/ (- date (calendar-absolute-from-iso (list 1 1 year))) 7))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
75 (% date 7)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
76 year)))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
77
92833
272f566348a7 (generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents: 92818
diff changeset
78 ;;;###cal-autoload
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
79 (defun calendar-iso-date-string (&optional date)
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
80 "String of ISO date of Gregorian DATE, default today."
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 38422
diff changeset
81 (let* ((d (calendar-absolute-from-gregorian
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
82 (or date (calendar-current-date))))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
83 (day (% d 7))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
84 (iso-date (calendar-iso-from-absolute d)))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
85 (format "Day %s of week %d of %d"
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
86 (if (zerop day) 7 day)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
87 (extract-calendar-month iso-date)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
88 (extract-calendar-year iso-date))))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
89
92833
272f566348a7 (generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents: 92818
diff changeset
90 ;;;###cal-autoload
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
91 (defun calendar-print-iso-date ()
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
92 "Show equivalent ISO date for the date under the cursor."
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
93 (interactive)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
94 (message "ISO date: %s"
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
95 (calendar-iso-date-string (calendar-cursor-to-date t))))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
96
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
97 (defun calendar-iso-read-args (&optional dayflag)
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
98 "Interactively read the arguments for an ISO date command.
92625
e26350e23411 (calendar-iso-read-args): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92609
diff changeset
99 Reads a year and week, and if DAYFLAG is non-nil a day (otherwise
e26350e23411 (calendar-iso-read-args): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92609
diff changeset
100 taken to be 1)."
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
101 (let* ((year (calendar-read
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
102 "ISO calendar year (>0): "
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
103 (lambda (x) (> x 0))
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
104 (int-to-string (extract-calendar-year
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
105 (calendar-current-date)))))
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
106 (no-weeks (extract-calendar-month
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
107 (calendar-iso-from-absolute
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
108 (1-
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
109 (calendar-dayname-on-or-before
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
110 1 (calendar-absolute-from-gregorian
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
111 (list 1 4 (1+ year))))))))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
112 (week (calendar-read
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
113 (format "ISO calendar week (1-%d): " no-weeks)
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
114 (lambda (x) (and (> x 0) (<= x no-weeks)))))
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
115 (day (if dayflag (calendar-read
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
116 "ISO day (1-7): "
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
117 (lambda (x) (and (<= 1 x) (<= x 7))))
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
118 1)))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
119 (list (list week day year))))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
120
92833
272f566348a7 (generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents: 92818
diff changeset
121 ;;;###cal-autoload
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
122 (defun calendar-goto-iso-date (date &optional noecho)
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
123 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil."
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
124 (interactive (calendar-iso-read-args t))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
125 (calendar-goto-date (calendar-gregorian-from-absolute
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
126 (calendar-absolute-from-iso date)))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
127 (or noecho (calendar-print-iso-date)))
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
128
92833
272f566348a7 (generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents: 92818
diff changeset
129 ;;;###cal-autoload
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
130 (defun calendar-goto-iso-week (date &optional noecho)
92818
3ed51c637a80 (calendar-absolute-from-iso, calendar-iso-read-args): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92625
diff changeset
131 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil.
57324
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
132 Interactively, goes to the first day of the specified week."
f51c087984a0 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
133 (interactive (calendar-iso-read-args))
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
134 (calendar-goto-date (calendar-gregorian-from-absolute
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135 (calendar-absolute-from-iso date)))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
136 (or noecho (calendar-print-iso-date)))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
137
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
138 (defvar date)
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
139
92609
733bd38ed2dd Comments.
Glenn Morris <rgm@gnu.org>
parents: 92586
diff changeset
140 ;; To be called from list-sexp-diary-entries, where DATE is bound.
92833
272f566348a7 (generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents: 92818
diff changeset
141 ;;;###diary-autoload
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
142 (defun diary-iso-date ()
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
143 "ISO calendar equivalent of date diary entry."
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
144 (format "ISO date: %s" (calendar-iso-date-string date)))
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
145
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
146 (provide 'cal-iso)
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
147
92586
15aa69393e42 Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents: 79703
diff changeset
148 ;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6
13053
621d48117fde Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
149 ;;; cal-iso.el ends here