You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/use-i18n/src/__tests__/__snapshots__/formatDate.test.ts.snap
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,36 @@ exports[`formatDate > should work with format "numericHour", for date = "new Dat
186
186
187
187
exports[`formatDate > should work with format "numericHour", for date = "new Date(2020, 1, 13, 16, 28)" and locale "ro" 1`] =`"2020-02-13 16:28"`;
188
188
189
+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "de" 1`] =`"13. Februar 2020 um 15:28:00"`;
190
+
191
+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "en" 1`] =`"February 13, 2020 at 3:28:00 PM"`;
192
+
193
+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "es" 1`] =`"13 de febrero de 2020, 15:28:00"`;
194
+
195
+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "fr" 1`] =`"13 février 2020 à 15:28:00"`;
196
+
197
+
exports[`formatDate > should work with format "second", for date = "2020-02-13T15:28:00.000Z" and locale "ro" 1`] =`"13 februarie 2020 la 15:28:00"`;
198
+
199
+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "de" 1`] =`"13. Februar 2020 um 15:28:00"`;
200
+
201
+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "en" 1`] =`"February 13, 2020 at 3:28:00 PM"`;
202
+
203
+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "es" 1`] =`"13 de febrero de 2020, 15:28:00"`;
204
+
205
+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "fr" 1`] =`"13 février 2020 à 15:28:00"`;
206
+
207
+
exports[`formatDate > should work with format "second", for date = "1581607680000" and locale "ro" 1`] =`"13 februarie 2020 la 15:28:00"`;
208
+
209
+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "de" 1`] =`"13. Februar 2020 um 16:28:00"`;
210
+
211
+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "en" 1`] =`"February 13, 2020 at 4:28:00 PM"`;
212
+
213
+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "es" 1`] =`"13 de febrero de 2020, 16:28:00"`;
214
+
215
+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "fr" 1`] =`"13 février 2020 à 16:28:00"`;
216
+
217
+
exports[`formatDate > should work with format "second", for date = "new Date(2020, 1, 13, 16, 28)" and locale "ro" 1`] =`"13 februarie 2020 la 16:28:00"`;
218
+
189
219
exports[`formatDate > should work with format "short", for date = "2020-02-13T15:28:00.000Z" and locale "de" 1`] =`"13. Feb. 2020"`;
190
220
191
221
exports[`formatDate > should work with format "short", for date = "2020-02-13T15:28:00.000Z" and locale "en" 1`] =`"Feb 13, 2020"`;
Copy file name to clipboardExpand all lines: packages/use-i18n/src/__tests__/formatDate.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ describe('formatDate', () => {
73
73
// @ts-expect-error we check a failing case
74
74
formatDate('fr',1581607680000,'not a valid format'),
75
75
).toThrowError(
76
-
'format "not a valid format" should be one of hour, hourOnly, long, short, shortWithoutDay, numeric, numericHour or a valid Intl.DateTimeFormat options object',
76
+
'format "not a valid format" should be one of second, hour, hourOnly, long, short, shortWithoutDay, numeric, numericHour or a valid Intl.DateTimeFormat options object',
0 commit comments