moment-lunar icon indicating copy to clipboard operation
moment-lunar copied to clipboard

AD-lunar conversion fails beyond year 2111

Open Infinite-Lop opened this issue 2 years ago • 1 comments

I may be nitpicking, but the lunar conversion function breaks beyond 2111. This should be due to the binary lookup table only contains leap year/leap month information upto 2111, and nevertheless the space occupied by the lookup table is not very large compared to the overall size of the package, so extending it is a nice choice to me.

moment().year(2111).month(6).date(6).lunar().format('YYYY-MM-DD'); "2111-06-01" moment().year(2112).month(6).date(6).lunar().format('YYYY-MM-DD'); "4223-08-27"

In order to prevent the next millennium bug, I wonder if anyone could provide a fix? Or if someone can give me some pointers on how this conversion is implemented, so that I can also contribute. Now I don't quite understand this conversion code so cannot help~

Infinite-Lop avatar May 01 '22 09:05 Infinite-Lop