diff --git a/src/locale/nl.js b/src/locale/nl.js index 6d9ff7b04..49dc6bbcc 100644 --- a/src/locale/nl.js +++ b/src/locale/nl.js @@ -8,7 +8,7 @@ const locale = { weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), monthsShort: 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'), - ordinal: n => `${n}${n === 1 || n === 8 || n >= 20 ? 'ste' : 'de'}`, + ordinal: n => `[${n}${n === 1 || n === 8 || n >= 20 ? 'ste' : 'de'}]`, weekStart: 1, yearStart: 4, formats: { diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js index 955f94032..2905538f6 100644 --- a/test/plugin/advancedFormat.test.js +++ b/test/plugin/advancedFormat.test.js @@ -8,6 +8,7 @@ import weekYear from '../../src/plugin/weekYear' import timezone from '../../src/plugin/timezone' import utc from '../../src/plugin/utc' import '../../src/locale/zh-cn' +import '../../src/locale/nl' dayjs.extend(utc) dayjs.extend(timezone) @@ -51,12 +52,16 @@ it('Format Day of Month Do 1 - 31', () => { expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) d = '2018-05-04 00:00:00.000' expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) + d = '2018-05-08 00:00:00.000' + expect(dayjs(d).locale('nl').format('Do')).toBe(moment(d).locale('nl').format('Do')) d = '2018-05-11' expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) d = '2018-05-12' expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) d = '2018-05-13' expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) + d = '2018-05-19 00:00:00.000' + expect(dayjs(d).locale('nl').format('Do')).toBe(moment(d).locale('nl').format('Do')) d = '2018-05-22' expect(dayjs(d).format('Do')).toBe(moment(d).format('Do')) })