#
d19ef5a2 |
| 02-Aug-2020 |
Aaron LI <aly@aaronly.me> |
calendar(1): Rewrite to support Chinese & Julian calendars
I wanted to use Chinese calendar in the calendar(1) utility, so I started working on it. The Chinese calendar is a lunisolar calendar and
calendar(1): Rewrite to support Chinese & Julian calendars
I wanted to use Chinese calendar in the calendar(1) utility, so I started working on it. The Chinese calendar is a lunisolar calendar and requires calculations of Sun and Moon positions. Along the way of implementing the Chinese calendar support, more and more parts of the old code has been replaced. Now, the new calendar(1) code base has been mostly rewritten to be more extensible to support multiple calendars. Although only the Gregorian (the default), Chinese and Julian calendars are currently supported, more calendars now becomes much easier to add.
Highlights: * Support Chinese calendar * Support Julian calendar * More accurate Sun and Moon calculations * More extensible * More calendar files/entries and more accurate information * Better code base
Major Changes: * If no user's calendar file, default to '/etc/calendar/default' * Search calendar files in '/etc/calendar', which allows to override the calendar file in '/usr/share/calendar' in a system-wide way * Add '-s' option to show information of Chinese/Julian calendar or Sun/Moon * Add '-H' option to specify the calendar home directory * Add '-L' option to specify the location, which should be set to get accurate Sun/Moon information * Add '-T' option to specify the current time for Sun/Moon calculations * Much Improved calendar file parser * More clean man page * More helpful error messages * Some bug fixes and various cleanups
The new calendar algorithms are implemented by referring to this great book: Calendrical Calculations: The Ultimate Edition (4th Edition) by Edward M. Reingold and Nachum Dershowitz. Cambridge University Press, 2018. ISBN: 9781107057623
More information about the development history of this calendar(1) utility can be found in my GitHub repository: https://github.com/liweitianux/ccalendar
show more ...
|