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

add support for calendars other than Gregorian #6

Open
BurntSushi opened this issue Mar 29, 2024 · 1 comment
Open

add support for calendars other than Gregorian #6

BurntSushi opened this issue Mar 29, 2024 · 1 comment
Labels
probably not An idea that probably isn't going to happen.

Comments

@BurntSushi
Copy link
Owner

BurntSushi commented Mar 29, 2024

When I initially started Jiff, my plan was always to stick to the Gregorian calendar. And I planned this even though Temporal specifically supports non-Gregorian calendars. Temporal has blazed a trail that shows how to support non-Gregorian calendars by effectively defining a mapping between non-Gregorian and ISO 8601 calendars (where ISO 8601 is basically equivalent to the Gregorian calendar), and then doing operations in ISO 8601 space. IIRC, there are some assumptions they make about calendars (like, numeral day 1 is always the first day of the month), but otherwise most everything is calendar independent.

My feelings on this have largely remained unchanged. I would prefer not support non-Gregorian calendars and instead point users toward other libraries, like icu_calendar, that specialize in this sort of thing.

It is possible my feelings could be changed on this matter in the future, but I think I'd want at least a few criteria to be satisfied first:

  1. Some very compelling use cases are provided.
  2. There aren't any plausible work-arounds external to Jiff.
  3. A strong abstraction barrier can be defined between most of the datetime arithmetic in this library and the details of non-Gregorian calendars.
  4. It can be an opt-in feature so that the vast majority of users that don't need this don't have to pay for it.
@BurntSushi BurntSushi changed the title TODO: add support for calendars other than Gregorian add support for calendars other than Gregorian Jul 7, 2024
@BurntSushi BurntSushi added the probably not An idea that probably isn't going to happen. label Jul 7, 2024
@nekevss
Copy link

nekevss commented Jul 23, 2024

FWIW, temporal_rs is currently planned to be a full implementation of the specification with non-gregorian calendar support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
probably not An idea that probably isn't going to happen.
Projects
None yet
Development

No branches or pull requests

2 participants