chronotope / chrono

Date and time library for Rust
Other
3.35k stars 533 forks source link

Discussion: Chrono calendar support (e.g. default, feature, or crate `chrono-calendar`?) #266

Open kestred opened 6 years ago

kestred commented 6 years ago

One of the current limitations listed of Chrono is its lack of support for diverse calendars. Correspondingly, chrono currently lacks strong APIs around calendaring/scheduling, resulting in occassional issues asking for "this or that" new method to be added to existing traits.

As rust's most widely used and supported date and time library, I am hoping that it can provide a robust calendar API.


The chrono README mentions that it has drawn inspiration from a variety of previous work (datetime-rs, rust-datetime, previous research, etc).

There are two libraries that I've worked with in other language that may also be strong examples of previous work that we could use to enhance Chrono.

With respect to multi-calendar support the Objective-C/Swift NSDate and NSCalendar libraries are the most full featured and well supported libraries I've found in any language to handle non-ISO calendars.

With respect to calendar APIs, the fairly new Luxon library has substantially reduced the complexity of calendar and scheduling features I've implemented with far fewer mistakes around handling calendar edge cases.


With that introduction, I'm hoping to learn more about the chrono developers thoughts on calendar support and plans for future chrono APIs.

pickfire commented 3 years ago

I think we could do this by adding generic on the date and decouple current geogorian calendar with the date integration so we can do other calendars.