diff --git a/src/laydate.js b/src/laydate.js index 0a75401..cb56ae3 100644 --- a/src/laydate.js +++ b/src/laydate.js @@ -910,7 +910,11 @@ value = value.split(' '+ options.range +' '); that.startDate = that.startDate || that.systemDate(); that.endDate = that.endDate || that.systemDate(); - options.dateTime = lay.extend({}, that.startDate); + if (options.selectEndDate) { + options.dateTime = lay.extend({}, that.endDate); + } else { + options.dateTime = lay.extend({}, that.startDate); + } lay.each([that.startDate, that.endDate], function(i, item){ initDate(item, value[i], i); }); @@ -1863,4 +1867,4 @@ }() ); -}(); \ No newline at end of file +}();