Merge pull request #6408 from msidolphin/fix#6404

fix: 修复bug #6404
This commit is contained in:
debugIsFalse 2020-01-17 16:34:40 +08:00 committed by GitHub
commit eea606d3bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -250,7 +250,7 @@
<template>
<div style="width: 500px;margin: 100px;">
<p><input type="text"></p>
<DatePicker type="month" show-week-numbers placeholder="Select date" style="width: 200px"></DatePicker>
<DatePicker type="year" show-week-numbers placeholder="Select date" style="width: 200px"></DatePicker>
@ -260,6 +260,8 @@
<DatePicker type="daterange" transfer show-week-numbers placeholder="Select date" style="width: 400px"></DatePicker>
<DatePicker type="datetimerange" transfer show-week-numbers placeholder="Select date" style="width: 400px"></DatePicker>
<Time-Picker :steps="[1, 1, 15]" :value="new Date()"></Time-Picker>
<DatePicker type="daterange" split-panels placeholder="Select date" style="width: 200px"></DatePicker>
</div>
</template>
<script>

View file

@ -296,11 +296,18 @@
},
changePanelDate(panel, type, increment, updateOtherPanel = true){
const current = new Date(this[`${panel}PanelDate`]);
if (panel === 'left') {
current[`set${type}`](current[`get${type}`](), 0);
} else {
if (this.splitPanels) {
// fix #6404
current[`set${type}`](current[`get${type}`]() + increment);
} else {
if (panel === 'left') {
current[`set${type}`](current[`get${type}`]() + increment);
} else {
current[`set${type}`](current[`get${type}`]() + increment);
}
}
this[`${panel}PanelDate`] = current;
if (!updateOtherPanel) return;