-
Notifications
You must be signed in to change notification settings - Fork 114
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
Chinese Holiday #43
Comments
There is a branch of jollyday from Soeren Strassfeld who tried to implement a chinese calendar. I haven't checked if he succeeded. Do you mind checking it? Come back any time an if it is ok I will try to merge it then. https://github.com/soe78/jollyday Cheers and thanks in advance. |
I still hat no time to check the fork in my application, but the code doesn't look like it is completed. I will come back as soon as I had the time to try it. |
I'm very sorry I "ignored" Jollyday for almost 2 years after playing around with it and then coming back and find my name in an open issue.
|
@soe78 My main problem with ICU4J is not that it forms another dependency but because its astronomical calculations are known to be not very precise. And this fact causes some chinese calendar dates in ICU4J to be wrong at least in historic times. By the way, my hope that standard Java will ever realize this calendar is almost zero because it is not simple at all, requires strong astronomical background and has occasionally leap months which don't fit well in the java.time-calendar design (Chinese leap months require the SAME number as the foregoing month but this is not possible neither in the ICU4J-design nor in the new java.time.chrono-design). You seem to think that the islamic calendar of Java-8 is difficult, but it is basically just a data table of month lengths per year (always 12 months) so it was relatively easy to implement. The Chinese calendar is really in another league of complexity. Anyway, I think I can implement the Chinese calendar in medium term (hopefully until spring 2018) because I have already done some important preparations, for example calculation of new moon and east asian months, see also an issue in my lib Time4J. After that, I can also imagine to contribute Chinese holidays to this project. |
@MenoData @soe78 A perfect implementation would be imho a JDK |
@svendiedrichsen Unfortunately the calendar design of JDK (java.time.chrono) is not perfect. It is mainly designed for calendars with regular year-month-day-scheme and was never tested or discussed in more depth for calendars with different structures (calendar experts for Hebrew or Chinese were practically not involved). So I fear that any hackish workaround in Threeten-Extra will also be broken or insufficient in several details (like now the i18n-features of Ethiopian calendar [to be fair, here not relevant for Jollyday] or the algorithmic limitations of actual JDK-8-HijrahCalendar - only Umalqura is offered [this is relevant for Jollyday]). |
If a But the good news is, my lib Time4J would take into account all aspects of a Chinese calendar in the future, including wide formatting and parsing capabilities in many languages. |
Looking forward to hearing from you. |
@MenoData as I've seen you have completed your work on the chinese calendar part in your lib Time4J. Could you tell us if and when your time allows you to contribute Chinese holidays to jolliday? |
@fanste Yes, the Chinese calendar part of Time4J is now finished and ready to use. If we only speak about Java-8 then nothing will prevent a new pull request. But some few things are still to do in context of modular Java-9 and OSGi. I hope to find some time for the necessary adjustments soon (mainly on the area of resource loading). Some work has already been done, for example automatic module names. These issues are similar to the obstacles with the combination of Jollyday and Java-9 (indirectly via the actual dependency on Threeten-Extra). |
Is there a chance to get a chinese holiday XML file? Is the library even prepared to calculate those holidays?
Thanks.
The text was updated successfully, but these errors were encountered: