first change
This commit is contained in:
26
public/assets/js/date-picker/date-picker.init.js
Normal file
26
public/assets/js/date-picker/date-picker.init.js
Normal file
@@ -0,0 +1,26 @@
|
||||
$('.daterange-custom-picker').daterangepicker({
|
||||
"showDropdowns": true,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"alwaysShowCalendars": true,
|
||||
"cancelClass": "btn-danger"
|
||||
}, function (start, end, label) {
|
||||
// console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') +
|
||||
// ' (predefined range: ' + label + ')');
|
||||
});
|
||||
|
||||
$('.daterange-custom-picker').on('apply.daterangepicker', function (ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' to ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
|
||||
$('.daterange-custom-picker').on('cancel.daterangepicker', function (ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
Reference in New Issue
Block a user