DatePicker: fix marks are displaced when type is range, fixed #2612

pull/2843/head
qingwei.li 2017-02-13 18:22:40 +08:00 committed by 杨奕
parent c310ee5661
commit 5fc34777b7
2 changed files with 3 additions and 3 deletions

View File

@ -118,6 +118,6 @@ if (isProd) {
cooking.add('plugin.CopyWebpackPlugin', new CopyWebpackPlugin([ cooking.add('plugin.CopyWebpackPlugin', new CopyWebpackPlugin([
{ from: 'examples/versions.json' } { from: 'examples/versions.json' }
])); ]));
cooking.add('plugin.OfflinePlugin', new OfflinePlugin()); isProd && cooking.add('plugin.OfflinePlugin', new OfflinePlugin());
cooking.add('vue.preserveWhitespace', false); cooking.add('vue.preserveWhitespace', false);
module.exports = cooking.resolve(); module.exports = cooking.resolve();

View File

@ -270,7 +270,7 @@
getDateOfCell(row, column) { getDateOfCell(row, column) {
const startDate = this.startDate; const startDate = this.startDate;
return new Date(startDate.getTime() + (row * 7 + (column - (this.showWeekNumber ? 1 : 0))) * DAY_DURATION); return new Date(startDate.getTime() + (row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay) * DAY_DURATION);
}, },
getCellByDate(date) { getCellByDate(date) {
@ -322,7 +322,7 @@
const cell = row[j]; const cell = row[j];
const index = i * 7 + j + (this.showWeekNumber ? -1 : 0); const index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
const time = startDate.getTime() + DAY_DURATION * index; const time = startDate.getTime() + DAY_DURATION * (index - this.offsetDay);
cell.inRange = minDate && time >= clearHours(minDate) && time <= clearHours(maxDate); cell.inRange = minDate && time >= clearHours(minDate) && time <= clearHours(maxDate);
cell.start = minDate && time === clearHours(minDate.getTime()); cell.start = minDate && time === clearHours(minDate.getTime());