diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js index 71ded86d..b753c3d6 100644 --- a/src/plugin/localeData/index.js +++ b/src/plugin/localeData/index.js @@ -38,7 +38,8 @@ export default (o, c, dayjs) => { // locale needed later weekdaysShort: () => dayjs.weekdaysShort(), weekdaysMin: () => dayjs.weekdaysMin(), months: () => dayjs.months(), - monthsShort: () => dayjs.monthsShort() + monthsShort: () => dayjs.monthsShort(), + longDateFormat: format => localeObject.formats[format] } } diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js index 109d4780..a2e017e9 100644 --- a/test/plugin/localeData.test.js +++ b/test/plugin/localeData.test.js @@ -61,6 +61,10 @@ it('Global localeData', () => { expect(dayjsLocaleData.weekdays()).toEqual(momentLocaleData.weekdays()) expect(dayjsLocaleData.weekdaysShort()).toEqual(momentLocaleData.weekdaysShort()) expect(dayjsLocaleData.weekdaysMin()).toEqual(momentLocaleData.weekdaysMin()) + const longDateFormats = ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL'] + longDateFormats.forEach((f) => { + expect(dayjsLocaleData.longDateFormat(f)).toEqual(momentLocaleData.longDateFormat(f)) + }) }) })