diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js index 71ded86de..b753c3d67 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 109d4780d..a2e017e90 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)) + }) }) })