|
23 | 23 | <a v-for="(j,i) in days" @click="is($event)&&(day=j.i,ok(j))" :class="[(j.p||j.n)?`${pre}-date-out`:'',status(j.y,j.m,j.i,hour,minute,second,'YYYYMMDD')]" :key="i">{{j.i}}</a> |
24 | 24 | </div> |
25 | 25 | <div :class="`${pre}-months`" v-show="showMonths"> |
26 | | - <a v-for="(i,j) in local.months" @click="is($event)&&(showMonths=(m==='M'),month=j,(m==='M'&&ok()))" :class="[status(year,j,day,hour,minute,second,'YYYYMM')]" :key="j">{{i}}</a> |
| 26 | + <a v-for="(i,j) in local.months" @click="is($event)&&(showMonths=(m==='M'),month=j,(m==='M'&&ok('m')))" :class="[status(year,j,day,hour,minute,second,'YYYYMM')]" :key="j">{{i}}</a> |
27 | 27 | </div> |
28 | 28 | <div :class="`${pre}-years`" v-show="showYears"> |
29 | | - <a v-for="(i,j) in years" @click="is($event)&&(showYears=(m==='Y'),year=i,(m==='Y'&&ok()))" :class="[(j===0||j===11)?`${pre}-date-out`:'',status(i,month,day,hour,minute,second,'YYYY')]" :key="j">{{i}}</a> |
| 29 | + <a v-for="(i,j) in years" @click="is($event)&&(showYears=(m==='Y'),year=i,(m==='Y'&&ok('y')))" :class="[(j===0||j===11)?`${pre}-date-out`:'',status(i,month,day,hour,minute,second,'YYYY')]" :key="j">{{i}}</a> |
30 | 30 | </div> |
31 | 31 | <div :class="`${pre}-hours`" v-show="showHours"> |
32 | 32 | <div :class="`${pre}-title`">{{local.hourTip}}</div> |
@@ -220,14 +220,17 @@ export default { |
220 | 220 | const $this = this |
221 | 221 | let year = '' |
222 | 222 | let month = '' |
| 223 | + let day = '' |
223 | 224 | info && info.n && $this.nm() |
224 | 225 | info && info.p && $this.pm() |
225 | 226 | if (info === 'h') { |
226 | 227 | const time = $this.get(this.value) |
227 | 228 | year = time.year |
228 | 229 | month = time.month |
| 230 | + } else if (info === 'm' || info === 'y') { |
| 231 | + day = 1 |
229 | 232 | } |
230 | | - const _time = new Date(year || $this.year, month || $this.month, $this.day, $this.hour, $this.minute, $this.second) |
| 233 | + const _time = new Date(year || $this.year, month || $this.month, day || $this.day, $this.hour, $this.minute, $this.second) |
231 | 234 | if ($this.left && parseInt(_time.getTime() / 1000) > $this.end) { |
232 | 235 | this.$parent.dates[1] = _time |
233 | 236 | } |
|
0 commit comments