Image
Code

Moon Calendar 2022 - a bit off.

zach b.

Last edited Apr 05, 2023
Created on Mar 23, 2021
Forked from Moon Calendar 2024

a bit off. close enough for hippies, but not witches.


forked from Moon Calendar 2020 which is based on Moon Phase Calculators.

click anywhere to circle today's date.

calculates based on a known new moon date of 1970-01-07+20:35.

uses a lunarPeriod of 2551443000 milliseconds
wich is 29.530590278 days;
or 29 days 12 hours 44 minutes 3 seconds.

wikipedia suggests slightly different numbers but it seems to work pretty good.
2021, at least, visually checks out against a quick look at this calendar.

upon closer inspection, it is off.
the last full moon of the year is 2021-12-18+21:37:58. But this calcs it to be the 20th.
the first is 2021-01-28+12:18:35. But this calcs it to be the 29th.
most seem to be a day or two behind.

setting the "known new moon" to the last of 2020 tightened it up but it's still off.

two issues: the "now date" is calced from 00:00, morning_of, not night_of
and the lunar interval might be a little long?

MIT Licensed