Repository: iamkun/dayjs (JavaScript)

Issue:
wrong day in my timezone (UTC+3)
**Describe the bug**
I noticed a utc test failing after midnight at my timezone.

**Expected behavior**
Run tests.

**Information**
 - Day.js dev branch
 - OS: macos
 - Node v14.11.0
 - Time zone:(UTC+3)

![Screenshot 2020-10-02 at 1 55 43](https://user-images.githubusercontent.com/130606/94871507-d0b0a900-0452-11eb-8cbf-2d72c9ea184f.png)

```
 FAIL  test/plugin/objectSupport.test.js
  ● Constructor from Object UTC

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2020-10-02 15:25:50.125"
    Received:
      "2020-10-01 15:25:50.125"

      121 |   for (let i = 0; i < tests.length; i += 1) {
      122 |     expect(dayjs.utc(tests[i][0]).format(fmt)).toBe(tests[i][1])
    > 123 |     expect(moment.utc(tests[i][0]).format(fmt)).toBe(tests[i][1])
      124 |   }
      125 | })
      126 | it('Set from Object', () => {
      
      at Object.<anonymous> (test/plugin/objectSupport.test.js:123:49)


Test Suites: 1 failed, 58 passed, 59 total
Tests:       1 failed, 569 passed, 570 total
Snapshots:   0 total
Time:        3.982s
Ran all test suites.
```



Hints:

Patch:
diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js
--- a/src/plugin/localeData/index.js
+++ b/src/plugin/localeData/index.js
@@ -1,3 +1,5 @@
+import { t } from '../localizedFormat'
+
 export default (o, c, dayjs) => { // locale needed later
   const proto = c.prototype
   const getLocalePart = part => (part && (part.indexOf ? part : part.s))
@@ -11,6 +13,9 @@ export default (o, c, dayjs) => { // locale needed later
     return result.map((_, index) => (result[(index + (weekStart || 0)) % 7]))
   }
   const getDayjsLocaleObject = () => dayjs.Ls[dayjs.locale()]
+  const getLongDateFormat = (l, format) =>
+    l.formats[format] || t(l.formats[format.toUpperCase()])
+
   const localeData = function () {
     return {
       months: instance =>
@@ -23,7 +28,8 @@ export default (o, c, dayjs) => { // locale needed later
         (instance ? instance.format('dd') : getShort(this, 'weekdaysMin', 'weekdays', 2)),
       weekdaysShort: instance =>
         (instance ? instance.format('ddd') : getShort(this, 'weekdaysShort', 'weekdays', 3)),
-      longDateFormat: format => this.$locale().formats[format]
+      longDateFormat: format => getLongDateFormat(this.$locale(), format)
+
     }
   }
   proto.localeData = function () {
@@ -39,7 +45,7 @@ export default (o, c, dayjs) => { // locale needed later
       weekdaysMin: () => dayjs.weekdaysMin(),
       months: () => dayjs.months(),
       monthsShort: () => dayjs.monthsShort(),
-      longDateFormat: format => localeObject.formats[format]
+      longDateFormat: format => getLongDateFormat(localeObject, format)
     }
   }
 
diff --git a/src/plugin/localizedFormat/index.js b/src/plugin/localizedFormat/index.js
--- a/src/plugin/localizedFormat/index.js
+++ b/src/plugin/localizedFormat/index.js
@@ -1,5 +1,8 @@
 import { FORMAT_DEFAULT } from '../../constant'
 
+export const t = format =>
+  format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))
+
 export default (o, c, d) => {
   const proto = c.prototype
   const oldFormat = proto.format
@@ -12,7 +15,6 @@ export default (o, c, d) => {
     LLLL: 'dddd, MMMM D, YYYY h:mm A'
   }
   d.en.formats = englishFormats
-  const t = format => format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))
   proto.format = function (formatStr = FORMAT_DEFAULT) {
     const { formats = {} } = this.$locale()
     const result = formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {


Test patch:
diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js
--- a/test/plugin/localeData.test.js
+++ b/test/plugin/localeData.test.js
@@ -38,7 +38,7 @@ describe('Instance localeData', () => {
       expect(dayjsLocaleData.weekdaysMin()).toEqual(momentLocaleData.weekdaysMin())
       expect(dayjsLocaleData.weekdaysShort(d)).toBe(momentLocaleData.weekdaysShort(m))
       expect(dayjsLocaleData.weekdaysShort()).toEqual(momentLocaleData.weekdaysShort())
-      const longDateFormats = ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL']
+      const longDateFormats = ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL', 'l', 'll', 'lll', 'llll']
       longDateFormats.forEach((f) => {
         expect(dayjsLocaleData.longDateFormat(f)).toEqual(momentLocaleData.longDateFormat(f))
       })
@@ -61,7 +61,7 @@ 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']
+    const longDateFormats = ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL', 'l', 'll', 'lll', 'llll']
     longDateFormats.forEach((f) => {
       expect(dayjsLocaleData.longDateFormat(f)).toEqual(momentLocaleData.longDateFormat(f))
     })