Calendar Events are different the database field dates

Does anyone know why the calendar event date is different from the field dates. I have tried changing the time offsets, when I click away from the page and back it resets and is wrong.

In the image, the selected dark blue event starts july 13 and ends july 18th but in the calendar it shows July 13-17th, I have played with the time offsets but none adjust it to the correct dates.

Does anyone know what might be happening with the dates?

@OLR Could you please share the date format you are using?

+1 Would you mind sharing how you're setting the dates?

Hello Abbey, Dates are stored as Date in Postgres DB.

Here is output from the query.

image

This rental here should be 13-18th but shows 13-17th, if I play with the UTC offset I can sometimes get it to be 13-18th but when I use the app next is resets.

@AbbeyHernandez

It looks like we had this bug in an older version of Retool. What version are you currently on? Previously there was a bug in the Calendar component where the date is one day behind if default date is a date string vs datetime. Try using {{moment(date1.value)}} for the default date. Let me know if that workaround applies here.

@AbbeyHernandez Are you defining date1 separately?
image

My apologies that is coming from a date input component.

In your case you'll want to use whatever date you want to be set as the default. Enter every date string with moment. For example {{moment("2024-06-06")}}

@AbbeyHernandez Gave that a shot, still looks like the calendar events are all 1 day off. Any other solutions? we are on cloud so should be latest version.

@AbbeyHernandez Let me know if you have another idea, this makes the calendar unusable for managing our upcoming rentals. :frowning:

Would you mind sending me an export JSON of your app?

I saw the same behavior but was able to correct the times by using moment.js. Try wrapping your dates like {{moment(item.start_date)}} for the Start and {{moment(item.end_date)}} for the End in your mapped values. Please let me know if that works for you!