Repository: iamkun/dayjs
Pull request #2011 (2022-08-04 13:20:05)

fix: ordinal for nl not working
In dutch locale, the ordinal doesn't show properly, some letters get interpreted.

Before the fix: :x:
```javascript
dayjs().locale('nl').format('Do'); // 44e
dayjs('2022-08-23').locale('nl').format('Do'); // 230te
```

After the fix: :heavy_check_mark: 
```javascript
dayjs().locale('nl').format('Do'); // 4de
dayjs('2022-08-23').locale('nl').format('Do'); // 23ste
``` 


codecov[bot]: # [Codecov](https://codecov.io/gh/iamkun/dayjs/pull/2011?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#2011](https://codecov.io/gh/iamkun/dayjs/pull/2011?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (1bac271) into [dev](https://codecov.io/gh/iamkun/dayjs/commit/b5b7be121ccba32f0422f7a5ab96b16e9f37e170?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (b5b7be1) will **not change** coverage.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff            @@
##               dev     #2011   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          181       181           
  Lines         2074      2074           
  Branches       544       544           
=========================================
  Hits          2074      2074           
```


| [Impacted Files](https://codecov.io/gh/iamkun/dayjs/pull/2011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [src/locale/nl.js](https://codecov.io/gh/iamkun/dayjs/pull/2011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2xvY2FsZS9ubC5qcw==) | `100.00% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)


Patch:
diff --git a/src/locale/fr.js b/src/locale/fr.js
index e913b4a..be06169 100644
--- a/src/locale/fr.js
+++ b/src/locale/fr.js
@@ -34,7 +34,7 @@ const locale = {
     yy: '%d ans'
   },
   ordinal: (n) => {
-    const o = n === 1 ? 'er' : 'e'
+    const o = n === 1 ? 'er' : ''
     return `${n}${o}`
   }
 }
diff --git a/src/locale/nl.js b/src/locale/nl.js
index 6d9ff7b..49dc6bb 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: {


Test patch:
diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js
index 955f940..2905538 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'))
 })