fix: Fix dayjs.locale() returns current global locale
fix #601
<!-- Issuehunt Badges -->
[<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%24100%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/iamkun/dayjs/issues/601)
<!-- /Issuehunt Badges -->


**Describe the bug**
```
dayjs.locale() 
```
should returns `en` instead of `null`

**Expected behavior**
returns `en`

**Information**
 - Day.js Version v1.8.14
 - OS: Mac
 - Browser Chrome
 - Time zone: PST


<!-- Issuehunt content -->
<details>
<summary>
<b>IssueHunt Summary</b>
</summary>

#### [<img src='https://avatars0.githubusercontent.com/u/17680888?v=4' alt='iamkun' width=24 height=24> iamkun](https://issuehunt.io/u/iamkun) has been rewarded.

### Sponsors (Total: $100.00)

- [<img src='https://avatars3.githubusercontent.com/u/44827199?v=4' alt='issuehunt' width=24 height=24> issuehunt](https://issuehunt.io/u/issuehunt) ($100.00)

### Tips

- Checkout the [Issuehunt explorer](https://issuehunt.io/r/iamkun/dayjs/) to discover more funded issues.
- Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
</details>
<!-- /Issuehunt content-->
.locale method should returns current locale 
diff --git a/src/index.js b/src/index.js
index 03359c2d9..434f60362 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,7 +10,7 @@ const isDayjs = d => d instanceof Dayjs // eslint-disable-line no-use-before-def
 
 const parseLocale = (preset, object, isLocal) => {
   let l
-  if (!preset) return null
+  if (!preset) return L
   if (typeof preset === 'string') {
     if (Ls[preset]) {
       l = preset
@@ -66,7 +66,7 @@ const parseDate = (cfg) => {
 
 class Dayjs {
   constructor(cfg) {
-    this.$L = this.$L || parseLocale(cfg.locale, null, true) || L
+    this.$L = this.$L || parseLocale(cfg.locale, null, true)
     this.parse(cfg) // for plugin
   }
 
diff --git a/src/plugin/localeData/index.js b/src/plugin/localeData/index.js
index b85a838a4..dae8f7b65 100644
--- a/src/plugin/localeData/index.js
+++ b/src/plugin/localeData/index.js
@@ -1,4 +1,4 @@
-export default (o, c) => { // locale needed later
+export default (o, c, dayjs) => { // locale needed later
   const proto = c.prototype
   const localeData = function () {
     return {
@@ -12,5 +12,12 @@ export default (o, c) => { // locale needed later
   proto.localeData = function () {
     return localeData.bind(this)()
   }
+
+  dayjs.localeData = () => {
+    const localeObject = dayjs.Ls[dayjs.locale()]
+    return {
+      firstDayOfWeek: () => localeObject.weekStart || 0
+    }
+  }
 }
 

diff --git a/test/locale.test.js b/test/locale.test.js
index 8438bd095..1ac0aa9c2 100644
--- a/test/locale.test.js
+++ b/test/locale.test.js
@@ -110,4 +110,14 @@ describe('Instance locale inheritance', () => {
     expect(esDayjs.add(1, 'minute').format(format))
       .toBe('sábado 28, Abril')
   })
+
+  it('dayjs.locale() returns locale name', () => {
+    dayjs.locale(es)
+    moment.locale('es')
+    expect(dayjs.locale()).toBe(moment.locale())
+
+    dayjs.locale('en')
+    moment.locale('en')
+    expect(dayjs.locale()).toBe(moment.locale())
+  })
 })
diff --git a/test/plugin/localeData.test.js b/test/plugin/localeData.test.js
index 5e5e1cb95..7b42a69bf 100644
--- a/test/plugin/localeData.test.js
+++ b/test/plugin/localeData.test.js
@@ -2,6 +2,7 @@ import MockDate from 'mockdate'
 import moment from 'moment'
 import dayjs from '../../src'
 import localeData from '../../src/plugin/localeData'
+import '../../src/locale/zh-cn'
 
 dayjs.extend(localeData)
 
@@ -13,7 +14,7 @@ afterEach(() => {
   MockDate.reset()
 })
 
-it('localeData', () => {
+it('instance localeData', () => {
   const d = dayjs()
   const m = moment()
   const dayjsLocaleData = dayjs().localeData()
@@ -24,3 +25,16 @@ it('localeData', () => {
   expect(dayjsLocaleData.weekdaysMin(d)).toBe(momentLocaleData.weekdaysMin(m))
   expect(dayjsLocaleData.weekdaysShort(d)).toBe(momentLocaleData.weekdaysShort(m))
 })
+
+it('global localeData', () => {
+  dayjs.locale('zh-cn')
+  moment.locale('zh-cn')
+  let dayjsLocaleData = dayjs.localeData()
+  let momentLocaleData = moment.localeData()
+  expect(dayjsLocaleData.firstDayOfWeek()).toBe(momentLocaleData.firstDayOfWeek())
+  dayjs.locale('en')
+  moment.locale('en')
+  dayjsLocaleData = dayjs.localeData()
+  momentLocaleData = moment.localeData()
+  expect(dayjsLocaleData.firstDayOfWeek()).toBe(momentLocaleData.firstDayOfWeek())
+})

{"test/plugin/localeData.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "test/locale.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
{"test/timezone.test.js:Add Time days (DST)": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/get-set.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/utc.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/quarterOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/advancedFormat.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/weekYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/toArray.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js:Utc Offset": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isSameOrBefore.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js:Diff (DST)": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/locale/keys.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/utils.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/relativeTime.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/parse.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isMoment.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/toObject.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/localizedFormat.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/constructor.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/weekday.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isSameOrAfter.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/weekOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isLeapYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/comparison.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/query.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/calendar.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/declarations.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/badMutable.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/customParseFormat.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/locale/ru.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/minMax.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/dayOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isoWeeksInYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js:UTC add day in DST": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/manipulate.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/buddhistEra.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isBetween.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}}
{"test/plugin/localeData.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "test/locale.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
{"passed_count": 40, "failed_count": 1, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/plugin.test.js", "test/get-set.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/timezone.test.js:Utc Offset", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/isMoment.test.js", "test/plugin/toObject.test.js", "test/plugin/localizedFormat.test.js", "test/constructor.test.js", "test/plugin/weekday.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/plugin/isLeapYear.test.js", "test/comparison.test.js", "test/query.test.js", "test/plugin/localeData.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/locale.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js", "test/locale/ru.test.js", "test/plugin/minMax.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/isoWeeksInYear.test.js", "test/timezone.test.js:UTC add day in DST", "test/manipulate.test.js", "test/plugin/buddhistEra.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/display.test.js"], "skipped_tests": []}
{"passed_count": 38, "failed_count": 3, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/get-set.test.js", "test/plugin.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/timezone.test.js:Utc Offset", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/isMoment.test.js", "test/plugin/toObject.test.js", "test/plugin/localizedFormat.test.js", "test/constructor.test.js", "test/plugin/weekday.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/comparison.test.js", "test/plugin/isLeapYear.test.js", "test/query.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js", "test/locale/ru.test.js", "test/plugin/minMax.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/isoWeeksInYear.test.js", "test/timezone.test.js:UTC add day in DST", "test/plugin/buddhistEra.test.js", "test/manipulate.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/locale.test.js", "test/plugin/localeData.test.js", "test/display.test.js"], "skipped_tests": []}
{"passed_count": 40, "failed_count": 1, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/plugin.test.js", "test/get-set.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/timezone.test.js:Utc Offset", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/isMoment.test.js", "test/plugin/toObject.test.js", "test/plugin/localizedFormat.test.js", "test/constructor.test.js", "test/plugin/weekday.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/comparison.test.js", "test/plugin/isLeapYear.test.js", "test/query.test.js", "test/plugin/localeData.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/locale.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js", "test/locale/ru.test.js", "test/plugin/minMax.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/isoWeeksInYear.test.js", "test/timezone.test.js:UTC add day in DST", "test/manipulate.test.js", "test/plugin/buddhistEra.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/display.test.js"], "skipped_tests": []}