miqe / ken.js

Ethiopian Date converter that works for the browser and node.js
7 stars 1 forks source link

Incorrect Conversion #6

Closed utopiaio closed 7 years ago

utopiaio commented 7 years ago

The conversion algorithm is not correct (attached an image for example). For conversion, one should / must use Beyene-Kudlek algorithm. There are implementations for it (with tests) Java, JavaScript, Swift coming soon

Also, was there a reason to mutate Date object? As the Date object itself is not consistent across browsers it might cause edge case problems

When putting out Number / Date conversion for Ethiopic, one should be careful as most people will take it as-is

PS / Self Promotion Both Ethiopic-Calendar and Geezer were used in Showtime. I decided to give them their own repositories a while back as I thought people might find them useful

PPS Head on to geez.org. It is an absolute joy to read

wrong conversion

miqe commented 7 years ago

I know Beyene-Kudlek algorithm works well but i am trying to develop my own algorithm. As you suggested I've dropped the date mutation section, it was added for ease of access. Thanks for the heads up, i'll add tests and continuous integration soon. if i had known Ethiopic-Calendar was there before i started working on ken.js i would have definitely used that. Fixed this issue with #9 merge. screenshot from 2017-04-19 14-18-09

utopiaio commented 7 years ago

I know Beyene-Kudlek algorithm works well but I am trying to develop my own algorithm

That's a pretty bold move imo. The conversion algorithm has already been done. It would be better to implement it different languages rather than reinventing the wheel but then again having a better algorithm is always a 👍

I'll be watching this repository to see where the new algorithm lands 🥇