Issue with Incorrect Date Display on WeWeb Calendar

Hi everyone,

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?

Thanks in advance!

weweb might be using the browsers time zone to adjust the date value. You can adjust that by using the weweb date plugin

When dealing with dates ALWAYS ensure that you are storing dates in UTC or Z. Basically:

  1. Make sure that you are using the weweb Date plugin
  2. 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)
  3. 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

Thanks for the help! I managed to make it work after changing to timestamp!