I’m currently using the calendar element on WeWeb and linking it to my backend, where I have a “calendar” table to store event dates. However, I’m running into an issue with the dates appearing incorrectly on the frontend. Each event shows up one day earlier than the date set in my backend.
For example, if an event is set to 06/11/2024 in my backend, it appears as 05/11/2024 on the frontend calendar.
The date format my backend sends is YYYY-MM-DD (e.g., 2024-11-06).
The start date and end date are always the same.
Does anyone have any insights on how to resolve this issue?
When dealing with dates ALWAYS ensure that you are storing dates in UTC or Z. Basically:
Make sure that you are using the weweb Date plugin
Look at the date data you are sending to your backend and ENSURE that it is in UTC (check if you can see a letter Z in the date string)
This 1 and 2 above will ensure that your date is consistent in front end and backend this is due to timezone differences that may exist between your backend server and your frontend browser