时间区域选择区间优化

pull/1/head
xueli.xue 8 years ago
parent e4b6303a1e
commit c08984b56b

@ -31,22 +31,25 @@ $(function() {
// 过滤时间 // 过滤时间
$('#filterTime').daterangepicker({ $('#filterTime').daterangepicker({
timePicker: true, //是否显示小时和分钟 autoApply:false,
timePickerIncrement: 10, //时间的增量,单位为分钟 singleDatePicker:false,
timePicker12Hour : false, //是否使用12小时制来显示时间 showDropdowns:false, // 是否显示年月选择条件
format: 'YYYY-MM-DD HH:mm:ss', timePicker: true, // 是否显示小时和分钟选择条件
separator : ' - ', timePickerIncrement: 10, // 时间的增量,单位为分钟
timePicker24Hour : true,
opens : 'left', //日期选择框的弹出位置
ranges: { ranges: {
'1': [moment().subtract(1, 'hours'), moment()], '1': [moment().subtract(1, 'hours'), moment()],
'': [moment(), moment()], '': [moment().startOf('day'), moment().endOf('day')],
'': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], '': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
'7': [moment().subtract(6, 'days'), moment()], '7': [moment().subtract(6, 'days'), moment()],
'30': [moment().subtract(29, 'days'), moment()], '30': [moment().subtract(29, 'days'), moment()],
'': [moment().startOf('month'), moment().endOf('month')], '': [moment().startOf('month'), moment().endOf('month')],
'': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] '': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}, },
opens : 'left', //日期选择框的弹出位置
locale : { locale : {
format: 'YYYY-MM-DD HH:mm:ss',
separator : ' - ',
customRangeLabel : '', customRangeLabel : '',
applyLabel : '', applyLabel : '',
cancelLabel : '', cancelLabel : '',
@ -54,11 +57,12 @@ $(function() {
toLabel : '', toLabel : '',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ], daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '', '', '', '', '', '', '', '', '', '', '', '' ], monthNames : [ '', '', '', '', '', '', '', '', '', '', '', '' ],
firstDay : 1 firstDay : 1,
startDate: moment().startOf('day'),
endDate: moment().endOf('day')
} }
}); });
$('#filterTime').val( moment(new Date()).format("YYYY-MM-DD 00:00:00") + ' - ' + moment(new Date()).add(1, 'days').format("YYYY-MM-DD 00:00:00") ); // YYYY-MM-DD HH:mm:ss
// init date tables // init date tables
var logTable = $("#joblog_list").dataTable({ var logTable = $("#joblog_list").dataTable({
"deferRender": true, "deferRender": true,

Loading…
Cancel
Save