I’ve tried everything in order to change the estimated delivery date, the date is calculated according to the javascript (see code), and I’ve placed the code in my theme-editor.js file. Still, for some reason, javascript isn’t calculating correctly, (you can actually see that the range in the code is different from the range that’s showing on my website) If I change the number of days, the range keeps being stuck between 6 and 10 (I believe working days only) from now. Does anyone know how to fix this??? Any help will be appreciated!!!
// estimate the delivery date
if(document.getElementById('fromDate')) {
var dateStart = 8;
var dateEnd = 12;
var fromDate = Date.today().addDays(dateStart);
if (fromDate.is().saturday() || fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}
var toDate = Date.today().addDays(dateEnd);
if (toDate.is().saturday() || toDate.is().sunday()) {
toDate = toDate.next().monday();
}
document.getElementById('fromDate').innerHTML = fromDate.toString('dd/MM');
document.getElementById('toDate').innerHTML = toDate.toString('dd/MM');
}
})();
/* Start */
.template-page .page-width {max-width: 100% !important;}
/* End*/