alextselegidis / easyappointments

:date: Easy!Appointments - Self Hosted Appointment Scheduler
https://easyappointments.org
GNU General Public License v3.0
3.28k stars 1.26k forks source link

Grey out unavailable dates on booking #1598

Open michel-io opened 2 weeks ago

michel-io commented 2 weeks ago

the file it's assets/js/http/booking_http_client.js

on function applyUnavailableDates the code goes // Grey out unavailable dates. $selectDate[0]._flatpickr.set( 'disable', unavailableDates.map((unavailableDate) => new Date(unavailableDate)), );

when graying out unavailable dates on booking, the dates are mapped on UTC, and that causes issues for negative timezones

alextselegidis commented 1 week ago

Hello!

Thanks for submitting this.

Would it be possible to share an example including the provider and customer selected timezones?

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

michel-io commented 1 week ago

I noticed this specifically in the -5 time zone (America/Havana)

I was working in the early morning and noticed that the json that gives the list of blocked dates was giving the previous day, but the calendar was not blocking it.

and when you see the code I sent, notice that the method it uses is that you map the dates that come in as string to date objects, and in the process the object is created in UTC