Skip to content

feat: add timezone-aware opening hours#19

Merged
onmax merged 3 commits intomainfrom
feat/timezone-working-hours
Oct 3, 2025
Merged

feat: add timezone-aware opening hours#19
onmax merged 3 commits intomainfrom
feat/timezone-working-hours

Conversation

@onmax
Copy link
Copy Markdown
Member

@onmax onmax commented Oct 3, 2025

Summary

  • Add timezone-aware opening hours support
  • Add i18n support with 5 locales (en, es, de, fr, pt)
  • Add opening_hours and timezone columns to locations
  • Add date-fns-tz dependency for timezone handling
  • Organize dependencies into named catalogs (database, dev, framework, test, ui, utils)
  • Add unit tests for i18n functionality

Implementation

  • Store all dates in UTC, convert to local timezone only when checking opening hours
  • Use opening_hours library to parse OSM opening hours format
  • Use date-fns-tz for timezone conversion
  • Opening hours logic is inlined directly in the search endpoint
  • Client-side opening hours status display with next change time
  • Query parameter support for locale switching (?locale=xx)
  • Cookie-based locale persistence via @nuxtjs/i18n

Database Changes

  • New opening_hours TEXT column (nullable)
  • New timezone TEXT column (nullable)
  • Migration script included

Dependency Organization

Following the pattern from https://antfu.me/posts/categorize-deps, dependencies are now organized into named catalogs:

  • database: drizzle-kit, drizzle-orm, postgres
  • dev: linting and development tools
  • framework: Nuxt and core framework packages (including @nuxtjs/i18n)
  • test: testing utilities (vitest, @nuxt/test-utils, etc.)
  • ui: UI library and styling packages
  • utils: utility libraries

@nuxthub-admin
Copy link
Copy Markdown
Contributor

nuxthub-admin bot commented Oct 3, 2025

❌ Deployment failed crypto-map-next

Failed to deploy crypto-map-next df68fb6 to preview

📋 View deployment logs

@onmax onmax force-pushed the feat/timezone-working-hours branch from 735a561 to 6a4462e Compare October 3, 2025 10:09
@onmax onmax mentioned this pull request Oct 3, 2025
5 tasks
@onmax onmax merged commit 9f4e52c into main Oct 3, 2025
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