longbill/jquery-date-range-picker

Error on select default dates, text show UNDEFINED mounth and year

Opened this issue · 1 comments

I found an error in this plugin when I select by default date the same date that I use as a max date at the moment to configure this plugin..
Example:
function configDateRangePickerWithMaxMin(max = null) { return { format: 'DD-MM-YYYY', language: 'es', separator: ' al ', endDate: (max != null) ? moment(max, "DD-MM-YYYY").toDate() : null, monthSelect: true, yearSelect: true, getValue: function () { return $(this).val(); }, } }; var today = moment(new Date).format("DD-MM-YYYY"); //daterange input $("#reportrange-busqueda").dateRangePicker(configDateRangePickerWithMaxMin(today)) $("#reportrange-busqueda").data('dateRangePicker').setDateRange(today , today);
I hope this issue help you to improve this great plugin

Please provide a reproduction through JSFiddle or something similar.