Commit d33a1414 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

J2000 day number table

parent 99091ca7
;; Datime formats, compatibility with non-iso8601.
;; Liam Healy Fri Oct 12 2001 - 16:27
;; Time-stamp: <2013-02-20 23:48:40EST formats.lisp>
;; Time-stamp: <2013-02-24 16:20:30EST formats.lisp>
;; Copyright 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -92,13 +92,17 @@
'("Jan" "Feb" "Mar" "Apr" "May" "Jun"
"Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
(defparameter *month-names-full*
'("January" "February" "March" "April" "May" "June"
"July" "August" "September" "October" "November" "December"))
(defun jd-table (start-year end-year &optional (format :org))
"Write out a JD table in TeX, e.g. for class.
If d is the day of the month, add d+0.5 to the table
to get the J2000 day number for that day.
If csv is T, use csv for import into spread sheet.
IF nil, use TeX."
(format t (case format (:org "| Month") (t " Month")))
(format t (case format (:org "| Month\\Year") (t " Month")))
(loop for year from start-year to end-year
do
(format t
......@@ -115,7 +119,7 @@
(:csv "~& ~a")
(:org "~&| ~a")
(:tex "\\\\ ~& ~a "))
(elt *month-names* (1- month)))
(elt (if (eq format :org) *month-names-full* *month-names*) (1- month)))
(loop for year from start-year to end-year
do
(format t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment