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
Support Hindu calendars (modern) #851
Comments
Hi @MenoData I would like to start working on this if no one else is working on it? |
@SiddharthaAnand Thanks for feedback. Well, during the last months I had no time. But I think I will soon start working. Helpful contributions can be either on the level of internationalization, especially hindi scripts of month names and era names are highly welcome. The other field of work is the calendar algorithm itself, technically represented by an implementation of the interface What would you like to contribute? Personally I would start with enums or primitives of Hindu months and eras as first brick stones including translations. Latter one (translations) are important and harder to realize because the CLDR repository of unicode consortium has NO resources for the Hindu calendar. |
Hi @MenoData Thanks for the description. I would like to first go over how the other calendar systems have been implemented and then suggest how we can go about the hindu calendar implementation and how it can be done. Do you have any other sources to see how and what variants of calendars are there in hindi. |
I have now created the new branch "hindu" and implemented the most important eras according to the book Dershovitz/Reingold ("Calendrical calculations", 5th ultimate edition). Latter one is also my main source for the implementation of the calendrical algorithms. Those 6 eras I have now introduced also describe the different variations of hindu calendar. Currently I tend to identify about 6 variants with a preferred era (according to what I have specified in the commit). That is: Kali Yuga (for an ancient old Hindu calendar variant), Vikrama Samvat (Northern India), Saka (for the rest), Kollam (Malayalam calendar), Bengal (West Bengal) and Nepalese. The Hindu months can be based on the already existing enum About the general structure of the algorithms: We need - per variant - a bijective mapping from the count of days since 1972-01-01 to a quintuple: [year, month, leap-month, day, leap-day]. A new primitive called Furthermore, for example the Nepalese calendar variant is also available as table driven mapping (so useable for test purposes although the range of dates is pretty small). Maybe I can also find a table of test data for the Vikrama Samvat calendar. |
Forgotten to mention that every era is associated with a solar and a lunisolar calendar so we really talk about 12 variants. Although the solar calendars only need triple state (year, month, day without leaps) we can use quintuples where the leap-flags are always set to |
@MenoData |
@SiddharthaAnand There is no (legal) soft copy of the book by Dershovitz/Reingold, so I had to buy it. However, there is an older version of the part related to modern hindu calendar present in internet, namely: http://www.cs.tau.ac.il/~nachum/calendar-book/papers/hindu-paper.pdf Meanwhile (just now) I have started the implementation. Please have a look at the hindu branch and especially the class It is not easy to keep the overview of the confusing complexity of Hindu calendar family but I think I have found a reasonable way to structure the different variants, see the class mentioned above. As side note for possible enhancements: I can imagine to add an extra member to the class |
Finally the algorithmic variants of modern Hindu calendars are implemented. |
Links:
Dershovitz/Reingold also offers a valuable source of algorithms.
The text was updated successfully, but these errors were encountered: