Repository: iamkun/dayjs
Pull request #2024 (2022-08-12 12:49:43)

D2M


Patch:
diff --git a/README.md b/README.md
index 37bb2b9..dc6ca10 100644
--- a/README.md
+++ b/README.md
@@ -114,6 +114,8 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://github.com/vendure-ecommerce" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/39629390?s=52&v=4"></a>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<a href="https://github.com/dc7290" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/48201151?v=4"></a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://github.com/Velc" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/1551649?s=52&v=4"></a>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://github.com/projectdiscovery" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/50994705?s=52&v=4"></a>
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'))
 })