Skip to content

feat(time): centralized Intl date/time formatting stack#2

Merged
bigjohnn1 merged 1 commit into
devfrom
worktree-feat+app-time
Jun 4, 2026
Merged

feat(time): centralized Intl date/time formatting stack#2
bigjohnn1 merged 1 commit into
devfrom
worktree-feat+app-time

Conversation

@bigjohnn1
Copy link
Copy Markdown
Member

Replace scattered date-fns format() calls with a single source of truth in shared/utils/time.ts (TIME_PRESETS). Add wrapping the built-in for templates (SSR-safe, locale auto-injected, live relative) and useTime().formatTime() for JS contexts (table cells, $t interpolation).

  • shared/utils/time.ts: TIME_PRESETS + TimePreset / TimeAbsolutePreset types
  • App/Time.vue: wrapper over
  • useTime(): formatTime(date, preset, localeOverride?) via Intl.DateTimeFormat
  • migrate Article/Table, Client/Preferences, Tasks/Item, editor & uzivatel
  • i18n previously hardcoded task strings (common.tasks.completed/tags)
  • update MAP.md, add tests/unit/time.test.ts

formatDate (hybrid relative/absolute timestamp) stays on date-fns by design.

Replace scattered date-fns format() calls with a single source of truth
in shared/utils/time.ts (TIME_PRESETS). Add <AppTime> wrapping the built-in
<NuxtTime> for templates (SSR-safe, locale auto-injected, live relative) and
useTime().formatTime() for JS contexts (table cells, $t interpolation).

- shared/utils/time.ts: TIME_PRESETS + TimePreset / TimeAbsolutePreset types
- App/Time.vue: <AppTime :datetime preset> wrapper over <NuxtTime>
- useTime(): formatTime(date, preset, localeOverride?) via Intl.DateTimeFormat
- migrate Article/Table, Client/Preferences, Tasks/Item, editor & uzivatel
- i18n previously hardcoded task strings (common.tasks.completed/tags)
- update MAP.md, add tests/unit/time.test.ts

formatDate (hybrid relative/absolute timestamp) stays on date-fns by design.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app-topiqu Building Building Preview, Comment Jun 4, 2026 4:49pm

@bigjohnn1 bigjohnn1 merged commit e885ac7 into dev Jun 4, 2026
1 of 2 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