Skip to content

Commit 975d1c7

Browse files
committed
support all the available locales
1 parent a95aef3 commit 975d1c7

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

src/libs/DateUtils.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ import {
3434
import {formatInTimeZone, fromZonedTime, toDate, toZonedTime, format as tzFormat} from 'date-fns-tz';
3535
import {enGB} from 'date-fns/locale/en-GB';
3636
import {es} from 'date-fns/locale/es';
37+
import {fr} from 'date-fns/locale/fr';
38+
import {it} from 'date-fns/locale/it';
39+
import {ja} from 'date-fns/locale/ja';
40+
import {pl} from 'date-fns/locale/pl';
41+
import {ptBR} from 'date-fns/locale/pt-BR';
42+
import {zhCN} from 'date-fns/locale/zh-CN';
43+
import {de} from 'date-fns/locale/de';
44+
import {nl} from 'date-fns/locale/nl';
3745
import throttle from 'lodash/throttle';
3846
import Onyx from 'react-native-onyx';
3947
import type {ValueOf} from 'type-fest';
@@ -135,6 +143,30 @@ function setLocale(localeString: Locale | undefined) {
135143
case CONST.LOCALES.ES:
136144
setDefaultOptions({locale: es});
137145
break;
146+
case CONST.LOCALES.FR:
147+
setDefaultOptions({locale: fr});
148+
break;
149+
case CONST.LOCALES.DE:
150+
setDefaultOptions({locale: de});
151+
break;
152+
case CONST.LOCALES.IT:
153+
setDefaultOptions({locale: it});
154+
break;
155+
case CONST.LOCALES.JA:
156+
setDefaultOptions({locale: ja});
157+
break;
158+
case CONST.LOCALES.NL:
159+
setDefaultOptions({locale: nl});
160+
break;
161+
case CONST.LOCALES.PL:
162+
setDefaultOptions({locale: pl});
163+
break;
164+
case CONST.LOCALES.PT_BR:
165+
setDefaultOptions({locale: ptBR});
166+
break;
167+
case CONST.LOCALES.ZH_HANS:
168+
setDefaultOptions({locale: zhCN});
169+
break;
138170
default:
139171
break;
140172
}

0 commit comments

Comments
 (0)