Skip to content

Commit ff2ae64

Browse files
authored
Merge pull request Expensify#64561 from Expensify/lucien/fix-datePicker-translations
[CP Staging] Support all the available locales in the date picker
2 parents 457a4e9 + f85fee9 commit ff2ae64

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
@@ -32,8 +32,16 @@ import {
3232
subMinutes,
3333
} from 'date-fns';
3434
import {formatInTimeZone, fromZonedTime, toDate, toZonedTime, format as tzFormat} from 'date-fns-tz';
35+
import {de} from 'date-fns/locale/de';
3536
import {enGB} from 'date-fns/locale/en-GB';
3637
import {es} from 'date-fns/locale/es';
38+
import {fr} from 'date-fns/locale/fr';
39+
import {it} from 'date-fns/locale/it';
40+
import {ja} from 'date-fns/locale/ja';
41+
import {nl} from 'date-fns/locale/nl';
42+
import {pl} from 'date-fns/locale/pl';
43+
import {ptBR} from 'date-fns/locale/pt-BR';
44+
import {zhCN} from 'date-fns/locale/zh-CN';
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)