Commit 58c19eba authored by qingwei.li's avatar qingwei.li Committed by 杨奕

DatePicker: fix time range

parent 96c8ac08
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
handleConfirm(visible = false, first) { handleConfirm(visible = false, first) {
if (first) return; if (first) return;
const date = new Date(limitRange(this.currentDate, this.selectableRange)); const date = new Date(limitRange(this.currentDate, this.selectableRange, 'HH:mm:ss'));
this.$emit('pick', date, visible, first); this.$emit('pick', date, visible, first);
}, },
......
...@@ -141,11 +141,10 @@ export const getRangeHours = function(ranges) { ...@@ -141,11 +141,10 @@ export const getRangeHours = function(ranges) {
return hours; return hours;
}; };
export const limitRange = function(date, ranges) { export const limitRange = function(date, ranges, format = 'yyyy-MM-dd HH:mm:ss') {
if (!ranges || !ranges.length) return date; if (!ranges || !ranges.length) return date;
const len = ranges.length; const len = ranges.length;
const format = 'HH:mm:ss';
date = dateUtil.parse(dateUtil.format(date, format), format); date = dateUtil.parse(dateUtil.format(date, format), format);
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
......
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