Hi @briantp, it works for you because it’s only broken for some browser locales.
There is a bug in Hotel_Booking_Room_Addon.check_avibility()
, specifically this code doesn’t generate the correct date in all locales:
const currentDate = new Date();
const time = (Date.parse(currentDate.toLocaleDateString())) / 1000;
For example, with my Firefox set to en-gb, the above produces 05/02/2023
, which is then parsed as the second of May instead of the fifth of February.
Replacing the above two lines with the following fixes the issue:
const currentDate = new Date();
currentDate.setHours(0,0,0,0);
const time = currentDate / 1000;