(1- (calendar-absolute-from-islamic (list month 1 year))))))
(list month day year))))
+;;;###autoload
(defun calendar-islamic-date-string (&optional date)
"String of Islamic date before sunset of Gregorian DATE.
Returns the empty string if DATE is pre-Islamic.
""
(calendar-date-string islamic-date nil t))))
+;;;###autoload
(defun calendar-print-islamic-date ()
"Show the Islamic calendar equivalent of the date under the cursor."
(interactive)
(message "Date is pre-Islamic")
(message "Islamic date (until sunset): %s" i))))
+;;;###autoload
(defun calendar-goto-islamic-date (date &optional noecho)
"Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t."
(interactive
(let* ((today (calendar-current-date))
(year (calendar-read
"Islamic calendar year (>0): "
- '(lambda (x) (> x 0))
+ (lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-islamic-from-absolute
(last (islamic-calendar-last-day-of-month month year))
(day (calendar-read
(format "Islamic calendar day (1-%d): " last)
- '(lambda (x) (and (< 0 x) (<= x last))))))
+ (lambda (x) (and (< 0 x) (<= x last))))))
(list (list month day year))))
(calendar-goto-date (calendar-gregorian-from-absolute
(calendar-absolute-from-islamic date)))
(mark-visible-calendar-date
(calendar-gregorian-from-absolute date)))))))))
+;;;###autoload
(defun insert-islamic-diary-entry (arg)
"Insert a diary entry.
For the Islamic date corresponding to the date indicated by point.
nil t))
arg)))
+;;;###autoload
(defun insert-monthly-islamic-diary-entry (arg)
"Insert a monthly diary entry.
For the day of the Islamic month corresponding to the date indicated by point.
(calendar-cursor-to-date t)))))
arg)))
+;;;###autoload
(defun insert-yearly-islamic-diary-entry (arg)
"Insert an annual diary entry.
For the day of the Islamic year corresponding to the date indicated by point.
(provide 'cal-islam)
-;;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7
+;; Local Variables:
+;; generated-autoload-file: "cal-loaddefs.el"
+;; End:
+
+;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7
;;; cal-islam.el ends here
;;; Code:
-(defvar date)
-
(require 'calendar)
(defun calendar-absolute-from-iso (date)
(+ (calendar-dayname-on-or-before
1 (+ 3 (calendar-absolute-from-gregorian (list 1 1 year))))
(* 7 (1- week))
- (if (= day 0) 6 (1- day)))))
+ (if (zerop day) 6 (1- day)))))
(defun calendar-iso-from-absolute (date)
"Compute the `ISO commercial date' corresponding to the absolute DATE.
(% date 7)
year)))
+;;;###autoload
(defun calendar-iso-date-string (&optional date)
"String of ISO date of Gregorian DATE.
Defaults to today's date if DATE is not given."
(extract-calendar-month iso-date)
(extract-calendar-year iso-date))))
+;;;###autoload
(defun calendar-print-iso-date ()
"Show equivalent ISO date for the date under the cursor."
(interactive)
(let* ((today (calendar-current-date))
(year (calendar-read
"ISO calendar year (>0): "
- '(lambda (x) (> x 0))
+ (lambda (x) (> x 0))
(int-to-string (extract-calendar-year today))))
(no-weeks (extract-calendar-month
(calendar-iso-from-absolute
(list 1 4 (1+ year))))))))
(week (calendar-read
(format "ISO calendar week (1-%d): " no-weeks)
- '(lambda (x) (and (> x 0) (<= x no-weeks)))))
+ (lambda (x) (and (> x 0) (<= x no-weeks)))))
(day (if dayflag (calendar-read
"ISO day (1-7): "
- '(lambda (x) (and (<= 1 x) (<= x 7))))
+ (lambda (x) (and (<= 1 x) (<= x 7))))
1)))
(list (list week day year))))
+;;;###autoload
(defun calendar-goto-iso-date (date &optional noecho)
"Move cursor to ISO DATE; echo ISO date unless NOECHO is t."
(interactive (calendar-iso-read-args t))
(calendar-absolute-from-iso date)))
(or noecho (calendar-print-iso-date)))
+;;;###autoload
(defun calendar-goto-iso-week (date &optional noecho)
"Move cursor to ISO DATE; echo ISO date unless NOECHO is t.
Interactively, goes to the first day of the specified week."
(calendar-absolute-from-iso date)))
(or noecho (calendar-print-iso-date)))
+(defvar date)
+
(defun diary-iso-date ()
"ISO calendar equivalent of date diary entry."
(format "ISO date: %s" (calendar-iso-date-string date)))
(provide 'cal-iso)
-;;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6
+;; Local Variables:
+;; generated-autoload-file: "cal-loaddefs.el"
+;; End:
+
+;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6
;;; cal-iso.el ends here
(require 'calendar)
+;;;###autoload
(defun calendar-julian-from-absolute (date)
"Compute the Julian (month day year) corresponding to the absolute DATE.
The absolute date is the number of days elapsed since the (imaginary)
(/ (1- year) 4)
-2)))
+;;;###autoload
(defun calendar-julian-date-string (&optional date)
"String of Julian date of Gregorian DATE.
Defaults to today's date if DATE is not given.
(or date (calendar-current-date))))
nil t))
+;;;###autoload
(defun calendar-print-julian-date ()
"Show the Julian calendar equivalent of the date under the cursor."
(interactive)
(message "Julian date: %s"
(calendar-julian-date-string (calendar-cursor-to-date t))))
+;;;###autoload
(defun calendar-goto-julian-date (date &optional noecho)
"Move cursor to Julian DATE; echo Julian date unless NOECHO is t."
(interactive
(let* ((today (calendar-current-date))
(year (calendar-read
"Julian calendar year (>0): "
- '(lambda (x) (> x 0))
+ (lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-julian-from-absolute
(day (calendar-read
(format "Julian calendar day (%d-%d): "
(if (and (= year 1) (= month 1)) 3 1) last)
- '(lambda (x)
+ (lambda (x)
(and (< (if (and (= year 1) (= month 1)) 2 0) x)
(<= x last))))))
(list (list month day year))))
"Julian calendar equivalent of date diary entry."
(format "Julian date: %s" (calendar-julian-date-string date)))
+;;;###autoload
(defun calendar-absolute-from-astro (d)
"Absolute date of astronomical (Julian) day number D."
(- d 1721424.5))
+;;;###autoload
(defun calendar-astro-from-absolute (d)
"Astronomical (Julian) day number of absolute date D."
(+ d 1721424.5))
+;;;###autoload
(defun calendar-astro-date-string (&optional date)
"String of astronomical (Julian) day number after noon UTC of Gregorian DATE.
Defaults to today's date if DATE is not given."
(calendar-absolute-from-gregorian
(or date (calendar-current-date)))))))
+;;;###autoload
(defun calendar-print-astro-day-number ()
"Show astronomical (Julian) day number after noon UTC on date shown by cursor."
(interactive)
"Astronomical (Julian) day number (at noon UTC): %s.0"
(calendar-astro-date-string (calendar-cursor-to-date t))))
+;;;###autoload
(defun calendar-goto-astro-day-number (daynumber &optional noecho)
"Move cursor to astronomical (Julian) DAYNUMBER.
Echo astronomical (Julian) day number unless NOECHO is t."
(interactive (list (calendar-read
"Astronomical (Julian) day number (>1721425): "
- '(lambda (x) (> x 1721425)))))
+ (lambda (x) (> x 1721425)))))
(calendar-goto-date
(calendar-gregorian-from-absolute
(floor
(provide 'cal-julian)
-;;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae
+;; Local Variables:
+;; generated-autoload-file: "cal-loaddefs.el"
+;; End:
+
+;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae
;;; cal-julian.el ends here