openculinary / frontend

The RecipeRadar Frontend is a recipe search and meal planning application
GNU Affero General Public License v3.0
13 stars 2 forks source link

Fix: resolve issues with date/time localization #223

Closed jayaddison closed 1 year ago

jayaddison commented 1 year ago

Describe the reason for these changes and the problem that they solve

As reported in #222, date/time related items in the application aren't being resolved correctly. It turns out that there were multiple underlying causes that resulted in this situation:

It turns out that most of the localization support required is bundled into modern browsers as part of the ECMAScript Internationalization API (aka Intl).

We should probably migrate to use that functionality natively in the near-ish future to reduce dependencies. To ease the transition until then, luxon is a neat near-drop-in replacement for dayjs that builds upon Intl (so it takes us one step in the correct direction).

Briefly summarize the changes

  1. Provide an export from the application's i18n module to retrieve the current/resolved user-agent locale
  2. Migrate from dayjs to luxon

How have the changes been tested?

  1. Local development testing

List any issues that this change relates to Fixes #222.