n20-common-lib 3.2.49 → 3.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "3.2.49",
3
+ "version": "3.2.51",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -100,7 +100,7 @@ export default {
100
100
  },
101
101
  getOptionLabel(option) {
102
102
  if (this.labelMode === 'code-value') {
103
- return `${option.code} - ${option.label}`
103
+ return `(${option.code}) ${option.label}`
104
104
  }
105
105
  return option.label
106
106
  },
package/src/utils/date.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import dayjs from 'dayjs'
2
- import 'dayjs/locale/zh-cn'
3
2
 
4
3
  import relativeTime from 'dayjs/plugin/relativeTime'
5
4
 
6
- dayjs.locale('zh-cn')
5
+ const locales = require.context('dayjs/locale', false, /\.js$/)
6
+ locales.keys().forEach(locales)
7
+
8
+ const pageLang = window.localStorage.getItem('pageLang') || 'zh-cn'
9
+ dayjs.locale(pageLang)
7
10
 
8
11
  dayjs.extend(relativeTime)
9
12