Lunar is a minimal date and time library, based primarily on a proleptic Gregorian calendar, that focuses on simple operations. Its development is needs-driven, meaning that the library is open to contributions that add use cases not initially considered.
In particular, the library allows you to work with Time objects (a specific hour of the day), Date objects (a specific day of the year), Datetime objects (a combination of a Time and a Date), and Zoned_datetime objects (a Datetime associated with a Timezone).
The code (and the algorithms used) is designed to be as simple as possible and easy to extend (without any particular concern for performance... sorry).
Components
Describes the low-level components used as utilities for describing dates.
Era identifies the historical period relative to year numbering. In the Gregorian/ISO calendar there are two eras: BCE and CE. Since Lunar just support dates between the years 0000 (in an astronomic sense), BCE is probably never used.
Describes a resolution that allows, among other things, dates to be truncated. Since negative resolutions produce strange results, they are always converted to their absolute values.
Describes a duration in seconds (Lunar is essentially a Calendar library, so greater precision does not seem particularly useful). This is the most primitive type in the library, and the API exposes minimal set of arithmetic operations.
Ranges
Provides a generic way to describe orderable and iterable ranges.