daterangepicker插件很好用,但在使用时也会碰到各种各样的坑。当设置singleDatePicker:true,
时,双选插件变为单选插件,但有时会读取不到年份。
<input type="text" class="t_form_style col-lg-8 col-sm-8 col-xs-8 date1 active">
$('.date1').daterangepicker({
format : 'YYYY/MM/DD', //控件中from和to 显示的日期格式
singleDatePicker:true,
showDropdowns: true,
locale : {
applyLabel : '确定',
cancelLabel : '取消',
fromLabel : '起始时间',
toLabel : '结束时间',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
无报错,各种尝试未果。。。
经研究为input的类型问题。。。type="text"
属性需要敲一个空格
type="text "