n20-common-lib 2.2.12 → 2.2.13

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": "2.2.12",
3
+ "version": "2.2.13",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -124,7 +124,8 @@ export default {
124
124
  return this.value.startDate
125
125
  },
126
126
  set(value) {
127
- let todayDay = value ? new Date(value) : new Date()
127
+ if (value) {
128
+ let todayDay = value ? new Date(value) : new Date()
128
129
  let todayOfWeek = todayDay.getDay()
129
130
  let spendDay = 1
130
131
  if (todayOfWeek !== 0) {
@@ -143,6 +144,18 @@ export default {
143
144
 
144
145
  this.$emit('input', weekTime)
145
146
  this.$emit('change', weekTime)
147
+ } else {
148
+ this.$emit('input', {
149
+ startDate: '',
150
+ endDate: '',
151
+ typeDate: this.value.typeDate
152
+ })
153
+ this.$emit('change', {
154
+ startDate: '',
155
+ endDate: '',
156
+ typeDate: this.value.typeDate
157
+ })
158
+ }
146
159
  }
147
160
  },
148
161
  month: {
@@ -178,7 +191,6 @@ export default {
178
191
  return this.value
179
192
  },
180
193
  set(value) {
181
- console.log(value, 2)
182
194
  this.$emit('input', Object.assign(value, { typeDate: this.type }))
183
195
  this.$emit('change', Object.assign(value, { typeDate: this.type }))
184
196
  }
@@ -128,16 +128,16 @@ export default {
128
128
  const [, year, quarter] = match
129
129
  switch (quarter) {
130
130
  case '1':
131
- this.$emit('input', { startDate: year + '01-01', endDate: year + '03-31' })
131
+ this.$emit('input', { startDate: year + '-' + '01-01', endDate: year + '-' + '03-31' })
132
132
  break
133
133
  case '2':
134
- this.$emit('input', { startDate: year + '04-01', endDate: year + '06-30' })
134
+ this.$emit('input', { startDate: year + '-' + '04-01', endDate: year + '-' + '06-30' })
135
135
  break
136
136
  case '3':
137
- this.$emit('input', { startDate: year + '07-01', endDate: year + '09-30' })
137
+ this.$emit('input', { startDate: year + '-' + '07-01', endDate: year + '-' + '09-30' })
138
138
  break
139
139
  case '4':
140
- this.$emit('input', { startDate: year + '10-01', endDate: year + '12-31' })
140
+ this.$emit('input', { startDate: year + '-' + '10-01', endDate: year + '-' + '12-31' })
141
141
  break
142
142
  default:
143
143
  break