Repository navigation
fix(apps-blog): emit JSON-LD dates as ISO date-times with a timezone - #638
Merged
Merged
Conversation
BlogPosting's datePublished/dateModified were emitted verbatim, so a bare YYYY-MM-DD from the admin's date picker failed Google's Rich Results Test (invalid datetime, missing timezone). Normalize them via a new toISODateTime helper, pinned to UTC like dateToTime, and drop values that can't be parsed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Midnight UTC is the previous evening across the Americas, so search results could show a post a day early. 08:00 UTC lands on the same calendar day from UTC-08:00 to UTC+14:00. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JonasJesus42
previously approved these changes
Oct 8, 2026
…heck dateToTime is lenient: Date rolls an impossible 2024-02-31 over into March, reads non-ISO strings in server-local time, and its 0-on-failure sentinel dropped a valid Unix-epoch date. scheduledTime range-checks the calendar fields and signals failure with null, so invalid dates are omitted and the epoch survives. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…zation side by side Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JonasJesus42
approved these changes
Oct 8, 2026
|
🎉 This PR is included in version 7.77.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
SeoBlogPostemitsBlogPost.dateverbatim as the BlogPosting'sdatePublished. That value is usually a bareYYYY-MM-DD(the admin's@format datepicker), which Google's Rich Results Test flags as an invalid datetime with a missing timezone.toBlogPosting(packages/apps-blog/src/utils/jsonLD.ts) now normalizesdatePublishedanddateModifiedthrough a newtoISODateTimehelper inutils/date.ts:2025-06-01→2025-06-01T08:00:00.000Z. A bare date has no time of day; 08:00 UTC rather than midnight keeps it on the same calendar day from UTC-08:00 to UTC+14:00, so search results in the Americas don't show the post a day early.scheduledTime's strict ISO check. An impossible date such as2024-02-31, or a non-ISO string, is dropped instead of emitted as invalid structured data. The Unix epoch is kept, not treated as a failure.Same fix for the Deno app in deco-cx/apps: deco-cx/apps#1685
Test plan
bun run testinpackages/apps-blog(165 passed, new cases indate.test.tsandseoSections.test.ts)bun run typecheckinpackages/apps-blogbiome checkon the changed files🤖 Generated with Claude Code
Summary by cubic
Fixes
BlogPostingstructured data sodatePublishedanddateModifiedare emitted as full ISO 8601 date-times with a timezone, satisfying Google's Rich Results Test.toISODateTimehelper: bareYYYY-MM-DDvalues are placed at 08:00 UTC so the calendar day stays the same from UTC-08:00 to UTC+14:00, offset-less date-times are pinned to UTC, and date-times with an offset keep their instant.scheduledTime's strict ISO check, so impossible calendar dates (like2024-02-31) and non-ISO strings are dropped instead of emitting invalid structured data, while the Unix epoch is still kept.Written for commit 320f118. Summary will update on new commits.