Skip to content

hanukkah, passover: start each holiday day at local sunset - #981

Merged
jvivona merged 6 commits into
tronbyt:mainfrom
jvivona:hanukkah-local-time-fix
Nov 30, 2026
Merged

jvivona merged 6 commits into
tronbyt:mainfrom
jvivona:hanukkah-local-time-fix

Conversation

@jvivona

@jvivona jvivona commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Bah.. Realized my math was off on my sunset specific apps. also determined Hanukkah countdown (UTC time zone + January bridge issue) & Passover countdown were off as well. went ahead and fixed both of those.

Fixed Holiday Countdown to be able to handle local sunset / sunrise.

** NOTE ** if you don't select a location - it'll consider sunset at 6PM on your tronbyt server's timezone.

here's the stack:

The order each app uses to pick a timezone:

  1. The Location setting's timezone, if a location is set.
  2. Otherwise the device timezone from the server.
  3. holidaycountdown only: if neither exists, it defaults to America/New_York. The two upstream apps have no hard-coded default and use whatever the server reports.

** Fixed layout for Passover as well **

==================================================================
Both apps decided the date from midnight-UTC timestamps and elapsed hours, so west of UTC they rolled over the previous evening. A Hebrew-calendar day actually begins at sunset, so this makes both apps switch at local sunset on the eve.

Both apps

  • New optional Location setting, used only to find local sunset (pixlet's sunrise module). With no location, or where the sun does not set, 6 PM local is used.
  • "Days until" counts local calendar days to the eve; "which day/night is it" advances at sunset.

hanukkah

  • Before: in US timezones the first candle appeared a night early, there was one candle too many every evening, and "Hanukkah is over" showed during the eighth night.
  • Now: night N starts at sunset, the eighth night runs until sunset on the final day, and the eve shows "Hanukkah starts tonight!".
  • A Hanukkah that runs past Dec 31 (2024, 2027) keeps the menorah up in January instead of switching to next year's countdown.

passover

  • The date table is now the eve of the first seder for every year. It previously mixed eve dates (2026, 2028) with first-day dates (2027, 2029-2034); 2035 was a month early and 2036 a day early. All eleven dates were checked against pyluach.
  • "First Seder" shows from sunset on the eve, and the eighth day ends at sunset.
  • The eve shows "Tonight" instead of "0 days", and the 2x countdown says "1 day" rather than "1 days".
  • 64x32 layout: the countdown now shows the year beside the Hebrew word (it was pushed off the panel), and the in-progress view uses one greeting line, "חג פסח שמח", so the day name and "Day N of 8" both fit. 2x and 64x64 renders are byte-identical to before.

Testing

  • Rendered fixed instants either side of sunset for Hanukkah 2026 and Passover 2026, with a location (Georgia, US and Tokyo) and without one, plus the Dec 31 / Jan 1 carry-over for 2024 and 2027.
  • Malformed, out-of-range and polar locations fall back to 6 PM without error.
  • pixlet format, lint and check pass for both apps. Only the Passover 64x32 layout changed, so passover.webp is the one preview image regenerated.

🤖 Generated with Claude Code

jvivona and others added 3 commits November 30, 2026 14:39
The first-night dates were parsed as midnight UTC and compared by elapsed
hours, so west of UTC everything rolled over the previous evening: the
countdown ran a day short, the first candle appeared a night early, and
"Hanukkah is over" showed during the eighth night.

Compare the viewer's local calendar date against the first-night date
instead, so the display changes at local midnight. The final day of the
holiday keeps all eight candles lit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The year was always the current calendar year, so a Hanukkah that started
in late December (2024, 2027) switched to a countdown to next December on
Jan 1 while candles were still being lit. Check whether the previous
year's holiday is still running first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A Hebrew-calendar day begins at sunset, so both apps now switch at sunset
on the eve rather than at midnight. Sunset comes from a new optional
Location setting; without one, 6 PM local is used.

hanukkah: night N starts at sunset, the eighth night runs to sunset on
the final day, and the eve shows "Hanukkah starts tonight!".

passover: the date table is now the eve of the first seder for every
year (it mixed eve and first-day dates; 2035 was a month early and 2036
a day early), the midnight-UTC elapsed-hours logic is gone, and the eve
shows "Tonight" instead of "0 days".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvivona
jvivona requested a review from tavdog as a code owner November 30, 2026 19:50
@jvivona
jvivona marked this pull request as draft November 30, 2026 19:53
jvivona and others added 2 commits November 30, 2026 15:16
The classic panel stacked about 41px of rows into 32px, so the year
never showed on the countdown and "Day N of 8" never showed during the
holiday. Give 64x32 its own layouts: the year sits beside the Hebrew
word, and the two Hebrew lines merge into one greeting. 2x and square
renders are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvivona
jvivona marked this pull request as ready for review November 30, 2026 22:07
@jvivona
jvivona merged commit eed487d into tronbyt:main Nov 30, 2026
1 check passed
@jvivona
jvivona deleted the hanukkah-local-time-fix branch December 1, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant