Calendar calculators in Scheme
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-26 12:26:32 -04:00
lib/calendars Init. 2026-09-26 12:24:21 -04:00
README.md Add example evaluation. 2026-09-26 12:26:32 -04:00

Calendars

Some calendars from Calendrical Calculations in Scheme, using SRFI 285's time and date system.

Examples

Approximate the date of Ramadan:

(define (ramadan gregorian-year)
  (let ((candidates (possible-islamic-dates-in-year
                     (romanized-name->month 'ramadan)
                     1
                     gregorian-year)))
    (map (lambda (x)
           (call-with-values (lambda ()
                               (date-ymd x))
                             list))
         candidates)))

(ramadan 2026) ;=> ((2026 2 18))
               ; Off by a day from observational (true) Ramadan

TODO

Chinese calendar

License

© 2026 Peter McGoron

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.