After adding +1 day and converting to ISO format, it will not execute correctly on the entry date 2022-03-27.
Isn't it related to daylight saving time?
If I also added the time to the date (2022-03-07 05:00:00), then the date conversion was correct.
But it is better for me to enter only the date.
function fnDp( inDtateIsoFormat ){
"use strict";
var d1 = inDtateIsoFormat,
dp = new Date(d1);
console.group("Date Bug JS "+d1+" +1 day");
console.log("dp:\n\t",dp,'\n\t',dp.toISOString().substring(0,10));
dp.setDate(dp.getDate()+1);
console.log("dp +1 day:\n\t",dp,'\n\t',dp.toISOString().substring(0,10));
console.groupEnd();
}
fnDp('2022-03-25');
fnDp('2022-03-27');
fnDp('2022-03-29');