daterangepicker
daterangepicker copied to clipboard
single and predefined ranges did not work togther
$(".daterangepicker-field").daterangepicker({ forceUpdate: false, orientation: 'left',
periods: ['month', 'quarter', 'year'],
ranges: {
'Last 30 days': [moment().subtract(29, 'days'), moment()],
'Last 90 days': [moment().subtract(89, 'days'), moment()],
'Last Year': [moment().subtract(1, 'year').add(1,'day'), moment()],
// 'All Time': 'all-time' // [minDate, maxDate]
// 'Custom Range': 'custom'
},
single: true,
callback: function(startDate, endDate, period){
var title = startDate.format('YYYY-MM-DD') + ' / ' + endDate.format('YYYY-MM-DD');
$(this).val(title);
document.getElementById('date_from').value = startDate.format('YYYY-MM-DD');
document.getElementById('date_to').value = endDate.format('YYYY-MM-DD');
}
});
Hi Karim, have you got the issue solved