Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kestred opened this issue Jul 17, 2018 · 1 comment

Comments

@kestred
Copy link

kestred commented Jul 17, 2018

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.

  • Useful API examples include beginningOf/endOf APIs as well as "calendar duration" or "calendar period" based Duration math (e.g. difference in round months; this date plus 30 months; etc)

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

@pickfire
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants