Skip to content

fix: publishedTime OG field passes bare YYYY-MM-DD string, parsed as UTC midnight by consumers #40

@planetf1

Description

@planetf1

Observed behaviour

generateMetadata in src/app/blogs/[slug]/page.tsx sets:

```ts
publishedTime: blog.date, // e.g. "2025-01-15"
```

The OG article:published_time spec expects an ISO 8601 datetime string. A date-only string is parsed as UTC midnight by strict consumers, which shifts the displayed date one day earlier for readers in UTC-behind timezones.

Impact

  • Social unfurls (LinkedIn, Slack, iMessage) may show yesterday's date on the preview card.
  • Search result snippets (Google article:published_time) may show the wrong date.

The page itself renders the correct date (fixed by #38), but metadata consumers see the unqualified string.

Expected behaviour

publishedTime should be a timezone-qualified ISO 8601 datetime, e.g.:

```ts
publishedTime: ${blog.date}T12:00:00,
```

Using noon ensures the correct calendar day is preserved across all UTC offsets (±14h).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions