Skip to content

Commit

Permalink
feat(mobile): add Vietnamese support for dates (#383)
Browse files Browse the repository at this point in the history
Issue: #283
  • Loading branch information
lamvh authored Sep 28, 2024
1 parent bc4ab4b commit 5e6d2ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/mobile/locales/provider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { dayjsExtended } from '@6pm/utilities'
import { i18n } from '@lingui/core'
import { I18nProvider } from '@lingui/react'
import AsyncStorage from '@react-native-async-storage/async-storage'
Expand All @@ -18,6 +19,8 @@ const defaultLanguage = ['en', 'vi'].includes(deviceLanguage)
? deviceLanguage
: 'en'

dayjsExtended.locale(deviceLanguage)

const messages = {
en: enMessages,
vi: viMessages,
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/src/date/dayjs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dayjsExtended from 'dayjs'
import isoWeek from 'dayjs/plugin/isoWeek'
import quarterOfYear from 'dayjs/plugin/quarterOfYear'
import 'dayjs/locale/vi'

dayjsExtended.extend(isoWeek)
dayjsExtended.extend(quarterOfYear)
Expand Down

0 comments on commit 5e6d2ae

Please sign in to comment.