Closed xouillet closed 3 years ago
Oh, wow, thanks. Seems like I made a mistake somwhere when I changed the library from moment to luxon and then made another mistake in the test code that hid it. In addition to what you mentioned, solar noon calculations seem to be broken pretty much everywhere (edit: that was just a small error in the test code). Will try to dig into this but of course if you can find the source of the error I would be very grateful.
I've managed to find a fix for sunrise/dusk/..., it is indeed linked to a luxon library call.
The solar noon are still broken though
Closed and will release to npm later today. Thanks again for spotting this!
Published on npm
Hi,
While testing your lib with city like Noumea or Auckland, I noticed big errors in sunrise calculation (for example, sunrise in Auckland returns 20:03 NZDT insted of 05:56). Sunset is ok thought (20:38 NZDT). After investigating, error appears with location with a longitude > 90 (but it seems ok with longitude < 90 thought).
The thing is, Auckland is tested in your test dataset, but I've found that all the tests made are not pertinent, because of an error in
expectCorrectTimeOrNoEventCode
function, aseventTime.diff(refEventTime).minutes
always returns 0,(eventTime.diff(refEventTime).as("minutes")
should be used here (cf. my pull request).