;;; cal-julian.el --- calendar functions for the Julian calendar
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2011 Free Software Foundation, Inc.
;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Keywords: calendar
;; Human-Keywords: Julian calendar, Julian day number, calendar, diary
+;; Package: calendar
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(defun calendar-julian-to-absolute (date)
"The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
The Gregorian date Sunday, December 31, 1 BC is imaginary."
- (let ((month (extract-calendar-month date))
- (year (extract-calendar-year date)))
+ (let ((month (calendar-extract-month date))
+ (year (calendar-extract-year date)))
(+ (calendar-day-number date)
(if (and (zerop (% year 100))
(not (zerop (% year 400)))
(year (calendar-read
"Julian calendar year (>0): "
(lambda (x) (> x 0))
- (int-to-string
- (extract-calendar-year
+ (number-to-string
+ (calendar-extract-year
(calendar-julian-from-absolute
(calendar-absolute-from-gregorian
today))))))
(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."
- (int-to-string
+ (number-to-string
(ceiling
(calendar-astro-from-absolute
(calendar-absolute-from-gregorian (or date (calendar-current-date)))))))
(defvar date)
-;; To be called from list-sexp-diary-entries, where DATE is bound.
+;; To be called from diary-list-sexp-entries, where DATE is bound.
;;;###diary-autoload
(defun diary-julian-date ()
"Julian calendar equivalent of date diary entry."
(format "Julian date: %s" (calendar-julian-date-string date)))
-;; To be called from list-sexp-diary-entries, where DATE is bound.
+;; To be called from diary-list-sexp-entries, where DATE is bound.
;;;###diary-autoload
(defun diary-astro-day-number ()
"Astronomical (Julian) day number diary entry."
(provide 'cal-julian)
-;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae
;;; cal-julian.el ends here