Commit 5fc34777 authored by qingwei.li's avatar qingwei.li Committed by 杨奕

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

parent c310ee56
......@@ -118,6 +118,6 @@ if (isProd) {
cooking.add('plugin.CopyWebpackPlugin', new CopyWebpackPlugin([
{ from: 'examples/versions.json' }
]));
cooking.add('plugin.OfflinePlugin', new OfflinePlugin());
isProd && cooking.add('plugin.OfflinePlugin', new OfflinePlugin());
cooking.add('vue.preserveWhitespace', false);
module.exports = cooking.resolve();
......@@ -270,7 +270,7 @@
getDateOfCell(row, column) {
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) {
......@@ -322,7 +322,7 @@
const cell = row[j];
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.start = minDate && time === clearHours(minDate.getTime());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment