-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Custom calendars #17
Comments
Hi, no there isn't at the moment. Could you please describe your use case? |
Hi @BenMorel, sure. Use case descriptionPlease take a look at this project: https://github.com/fisharebest/webtrees/ Webtrees is a online Genealogy software. That means, you input the date of an individuals birth, death, some-other-event in the date which was mentioned in the SOURCES. That said, you'd put in George Washingtons Birthday in the Julian Calendar, but when he died the gregorian calendar was in use. user storyAs a user, I'd expect to see the Proleptic calendar date of Washingtons birth (if I wanted to), and the age should also be calculated in the gregorian/proleptic style. technical background
We have a webtrees slack. A new version 2.0.0 (based on laravel) is on its way, but wouldn't include brick/date-time. I wanted to investigate if this library adds some benefits over the existing implementation. As you seem to know PHP and Java (including JSR310), I think you could explain the benefits of this implementation in the slack. But maybe I am mistaken, and JSR310 does not support the calendars I mentioned, because it is not as extensible as I remembered. Regards, |
Other things to consider: None of the other libraries can support this: |
Hi @bmhm, Thank you for your use case description. I'm open to adding support for custom calendars; however, I'm not familiar with other calendars at all, so unless I'm extensively briefed on the matter, and get enough time to work on it, I'm currently unable to help. Would you be interested in opening a PR to add support for these calendars? |
Phew. I looked into your code and I realized two things.
So I'm probably not able to help. |
If you give me some examples of how a different calendar affects the behaviour of existing classes such as |
There are a lot of examples on the web. I'm going to collect some of them here in multiple edits. |
If custom calendars just meant a different date for today (with the same year-month-day concept), this would probably be quite easy to implement. But from what I can see by quickly browsing your links, calendars like the Japanese one do not seem to use the same concept of year-month-day, you'd need an additional era field that does not have any meaning in our calendar, so it's a totally different beast and I'm not sure whether this is in the scope of this project (at least at the moment). |
Yes that's what I meant I'm the first place. I do not know of any library which could provide this. But yours is based on jsr310 and would be somewhat easy to extend to the same functionality. Yes, some calendar systems have a different number of months or not the concept of months at all. |
Although very similar, the project is not a direct port of JSR-310, it misses some concepts such as these calendars, and integrates others that, AFAIK, are missing in java.time, such as I'm not against integrating these calendars at some point in the future, but I won't be able to investigate this further at the moment. I'll keep this issue open, though, if someone wants to jump in and work on a PR! |
Thanks. I'll try to find someone to work with on this. Maybe we could even start a branch together at some point. |
Hi,
Is there are way to add custom calendars? I know in java this is possible.
If not, well, this is a feature request. 😉
The text was updated successfully, but these errors were encountered: