【发布时间】:2017-01-17 06:52:14
【问题描述】:
我有一个日期选择器,在这里我突出显示选定的时期。但是我在这里有一些问题,那就是 这是 2017 年 1 月,但是当我选择 2 月的某个时间段时,它在 二月,但默认显示当前月份 int datepicker 是一月。
代码
$("#daterangepicker1").datepicker({
inline: true,
beforeShowDay: function(date) {
var theday = (date.getMonth() + 1) + '/' +
date.getDate() + '/' +
date.getFullYear();
return [true, $.inArray(theday, dtrange) >= 0 ? "hightlight" : ''];
}
});
【问题讨论】:
-
你能用 plunker 重现这个问题吗?
标签: javascript jquery datetimepicker