8000 Anime-card start dates are UTC midnight of the day shown by irfan-dahir · Pull Request #666 · jikan-me/jikan · GitHub
[go: up one dir, main page]

Skip to content

Anime-card start dates are UTC midnight of the day shown - #666

Merged
irfan-dahir merged 1 commit into
v5/episode-aired-utcfrom
v5/card-dates-utc
Oct 15, 2026
Merged

irfan-dahir merged 1 commit into
v5/episode-aired-utcfrom
v5/card-dates-utc

Conversation

@irfan-dahir
Copy link
Copy Markdown
Collaborator

Stacked on #664 (base is v5/episode-aired-utc; retarget to master once that merges). Needs jikan-me/jikan-fixtures#18 merged too: CI clones fixtures master.

Found while comparing v4 and v5 side by side for the upgrade guide. Anime-card start dates (seasonal, schedule, genre, producer cards) were converted from midnight in Japan to UTC. That isn't what the rest of the library does, and it puts some dates in the wrong year when you read them:

Card shows Was Now
"Oct 2, 2026" 2026-10-01T15:00:00+00:00 2026-10-02T00:00:00+00:00
"2027" (year only) 2026-12-31T15:00:00+00:00 (previous year) 2027-01-01T00:00:00+00:00

Anime::getAired(), episode dates and DateRange are all UTC midnight, so one fact had two representations. The year-only case came from #656, where I kept the existing Japan-midnight conversion. A bare year used to give the current date and time, so it was wrong either way, but this is now correct. (Owner decision: UTC midnight.)

Change

  • Hidden start date and shown text both give UTC midnight (utcMidnight(); month- or year-only dates fall on the 1st).
  • Text with a broadcast time still converts from Japan time: "Apr 7, 2013, 01:00 (JST)" is 16:00 UTC the day before, a real instant. Live seasonal cards show only a day, so this is the older format.

Verified

  • AnimeCardHiddenFieldsTest: every card on every recorded card page is UTC midnight of its hidden date; year-only, month-only and unknown dates; the shown-text fallback including the broadcast time.
  • Snapshots: 2,049 dates in 12 files move by exactly +9 hours, and a script checked nothing else changed.
  • jikan-rest isn't affected: its seasonal and schedule indexers only read card ids and titles.

Changelog entry under Changed.

🤖 Generated with Claude Code

Cards were converted from midnight in Japan to UTC, so "Oct 2, 2026" read as
2026-10-01T15:00Z and a year-only "2027" as 2026-12-31T15:00Z (the previous year),
while Anime::getAired(), the episodes and DateRange are UTC midnight. The hidden
start date and the shown text now both give UTC midnight; text with a broadcast
time still converts from Japan time (a real instant).

Checked on every recorded card page: 2,049 snapshot dates move by exactly +9 hours
and nothing else changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@irfan-dahir
irfan-dahir merged commit 5673fb4 into v5/episode-aired-utc Oct 15, 2026
7 of 13 checks passed
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

0