Skip to content

Commit

Permalink
fix: ordinal for nl not working (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessier committed Aug 12, 2022
1 parent dd192a7 commit c93c85e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
5 changes: 5 additions & 0 deletions test/plugin/advancedFormat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'))
})
Expand Down

0 comments on commit c93c85e

Please sign in to comment.