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

Evaluate existing calendar conversion libs #1

Open
tobiasschweizer opened this issue Dec 10, 2017 · 2 comments
Open

Evaluate existing calendar conversion libs #1

tobiasschweizer opened this issue Dec 10, 2017 · 2 comments

Comments

@tobiasschweizer
Copy link
Collaborator

tobiasschweizer commented Dec 10, 2017

A search on npmjs.com for "calendar Julian " returned the following results:

  • github.com/wraithgar/moonbeams
  • github.com/stevebest/julian
  • github.com/vanng822/amlich
  • github.com/deitch/jsorm-i18n

This libs should be evaluated (in order to check for correctness of our own implementation).

Ideally, the conversions functions (everything in JDNCalendarConversion) could be handled in a separate or even external module. I could image putting all of the conversions offered by https://www.fourmilab.ch/documents/calendar/ in a separate module that could be used by JDNConvertibleCalendar.

@jlayt
Copy link

jlayt commented Jul 14, 2018

Hi,

Saw your post on the Angular blog via Twitter. In the past I've maintained a couple of C++ libraries for calendar conversions via Julian Days and picker widgets, and built up a lot of documentation on various calendar systems. My last (incomplete) effort implementing a subset of them can be found here:

https://github.com/KDE/kholidays/blob/master/src/parsers/qcalendarsystem_p.h
https://github.com/KDE/kholidays/blob/master/src/parsers/qcalendarsystem.cpp

It's GPL, so feel free to pillage the code or algorithms, the source reference for each is provided (some key algorithms are sadly copyright or license restricted, this version only includes those I know are GPL compatible). It's missing translations of day/month names and auto-tests (I have them somewhere on my hard-drive...), those restricted algorithms (I have them too if you want, but they are mostly on fourmilab anyway), and the astronomical calendars which I never completed, but it may be a useful start point.

I do some DH-related web dev these days, but not Angular, so I may not be able to contribute code, but I'd be happy to try answer questions if you need help.

John.

@tobiasschweizer
Copy link
Collaborator Author

Hi John,

Thanks a lot for offering your help. If you want, you can have a look at this open PR: #4

It basically implements the algorithms given by John Meeus, but some tweaks were necessary too. Maybe you could give us some advice about missing or incomplete tests in https://github.com/dhlab-basel/JDNConvertibleCalendar/blob/wip/formula/test/UnitTests.ts

I had a look at your code and discovered that you have negative JDs. I think the algorithms of Meeus only work for non negative JDs.

Btw: This library is not restricted to Angular, there is another development https://github.com/dhlab-basel/JDNConvertibleCalendarDateAdapter that contains all the Angular specific things.

Thanks again!

Tobias

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

No branches or pull requests

2 participants