fix(airdatebadge): anchor day diff to UTC midnight instead of raw ms delta #3273
Open
fallenbagel wants to merge 1 commit into
Open
fix(airdatebadge): anchor day diff to UTC midnight instead of raw ms delta
#3273fallenbagel wants to merge 1 commit into
fallenbagel wants to merge 1 commit into
Conversation
Contributor
📝 WalkthroughWalkthroughAirDateBadge compares air dates and the current date at UTC midnight, determines relative-display eligibility within an eight-day window, and passes an unrounded day difference to relative-time formatting. ChangesAirDateBadge relative-date calculation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fallenbagel
force-pushed
the
fix/airdatebadge-utc-day-boundary
branch
from
July 20, 2026 21:58
b6e3aae to
aa63888
Compare
…delta Math.round() on a raw ms delta flipped the relative label at noon UTC instead of the actual day boundary; both dates now truncate to UTC midnight before diffing. fix #3268
fallenbagel
force-pushed
the
fix/airdatebadge-utc-day-boundary
branch
from
July 20, 2026 21:59
aa63888 to
b82c690
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
AirDateBadgecomputed the relative day count by rounding a raw millisecond delta between the exact current instant and a UTC-midnight air date, so the day boundary landed at noon UTC instead of an actual calendar day change. On an episode's air date the badge flipped from "Aired today" to "Aired yesterday" starting at noon UTC, and the day before an air date it showed "Airing today" from noon UTC onward for an episode that doesn't air until the next day.Both dates are now truncated to UTC midnight before diffing, so the day count is always a whole number with no rounding involved. TMDB's
air_datehas no time or timezone attached, it's just the origin country's local date, so UTC isn't more "correct" here, it's just deterministic just like the absolute date badge next to it, which is already rendered in UTC. As a side effect, the Aired/Airing split changes slightly as the badge now reads "Airing" for the entire UTC day an episode airs and switches to "Aired" starting the following UTC day, instead of flipping almost immediately after midnight like before. Also renamed the WEEK constant to make it less confusing.How Has This Been Tested?
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit