So when the date is an empty array it will appear in the site without any starting date in the input field.
But there was a bug when I went throuh the day-month-year cycle, it got NaN values for the years and days.
I found out that it is not checked in the code where the new date is set.
if (options.mode != 'single') {
options.current = new Date(options.date[options.date.length - 1]);
}
I fixed the problem with a simple check of the value of the target, so it won't try to set a new date without any reference from the input.
if (options.mode != 'single') {
if (target.value !== '') {
options.current = new Date(options.date[options.date.length - 1]);
}
}
This problem appeared when I used PickMeUp for holiday picking where I needed the input field to be empty. I used it in my js file like this:
So when the date is an empty array it will appear in the site without any starting date in the input field. But there was a bug when I went throuh the day-month-year cycle, it got NaN values for the years and days. I found out that it is not checked in the code where the new date is set.
I fixed the problem with a simple check of the value of the target, so it won't try to set a new date without any reference from the input.