Open lamselli opened 1 year ago
I think the issue comes from that bit of code :
let centerDate = new Date();
if (idA[1] == "anyDate") {
input.value = "";
} else {
centerDate.setUTCFullYear(idA[1]);
centerDate.setUTCMonth(idA[2]-1);
centerDate.setUTCDate(idA[3]);
// input.value = centerDate;
input.value = centerDate.getUTCFullYear()+"-"+String(parseInt(centerDate.getUTCMonth())+1).padStart(2,"0")+"-"+String(parseInt(centerDate.getUTCDate())).padStart(2,'0');
}
When you'll set the month, it wont be correct as the date is 31. You should set date before setting the month or create a more specific center date, I think.
Thanks for this great library !
I releasd a new version, completely revisited. On the last day of Oct I'll check if it works, I think the problem was with UTC, I set this new version to use just local dates
Today is 05/31. If I try to pick a date in june, the date filled will be in July.