function createDateFunWithTime(id){
$('#'+id).daterangepicker({
autoApply: true,
showDropdowns: true,
autoUpdateInput:false,
timePicker: true,
timePicker24Hour:true,
timePickerIncrement: 10,
ranges: {
'今日': [moment(), moment()],
'昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'直近7日': [moment().subtract(6, 'days'), moment()],
'直近30日': [moment().subtract(29, 'days'), moment()],
'今月': [moment().startOf('month'), moment().endOf('month')],
'先月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
locale: {
applyLabel: '反映',
cancelLabel: '取消',
customRangeLabel: '自分で指定',
},
}, function(start, end, label) {
});
$('#'+id).on('apply.daterangepicker', function(ev, picker) {
$('#'+id).val(picker.startDate.format('YYYY/MM/DD HH:mm') + ' - ' + picker.endDate.format('YYYY/MM/DD HH:mm'));
});
$('#'+id).on('cancel.daterangepicker', function(ev, picker) {
$('#'+id).val('');
});
$('#'+id+'iDiv').on('click', function(event) {
$('#'+id).trigger('click');
});
}
$('#'+id).daterangepicker({
autoApply: true,
showDropdowns: true,
autoUpdateInput:false,
timePicker: true,
timePicker24Hour:true,
timePickerIncrement: 10,
ranges: {
'今日': [moment(), moment()],
'昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'直近7日': [moment().subtract(6, 'days'), moment()],
'直近30日': [moment().subtract(29, 'days'), moment()],
'今月': [moment().startOf('month'), moment().endOf('month')],
'先月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
locale: {
applyLabel: '反映',
cancelLabel: '取消',
customRangeLabel: '自分で指定',
},
}, function(start, end, label) {
});
$('#'+id).on('apply.daterangepicker', function(ev, picker) {
$('#'+id).val(picker.startDate.format('YYYY/MM/DD HH:mm') + ' - ' + picker.endDate.format('YYYY/MM/DD HH:mm'));
});
$('#'+id).on('cancel.daterangepicker', function(ev, picker) {
$('#'+id).val('');
});
$('#'+id+'iDiv').on('click', function(event) {
$('#'+id).trigger('click');
});
}