How to create event by selecting a date on the calendar?

I'm trying to use the new calendar component in my Retool app, but I found that I cannot select a time on the calendar to create an event. I can only configure it in the property panel?

Welcome to the forum!

If you add an event handler for the "create event" event (confusing name) then you should be able to trigger your script or query when the user double clicks on the calendar to create an event.
You'll need to give your calendar a data source and use the selectedInterval property to create the event.

Here's a quick example app to show one way to do it. Click or drag on the calendar to add an event at that time.
forum (1).json (6.9 KB)


Ooh good question, @yuning1207! Thank you for clearing that up, @dcartlidge.

As for drag-and-drop event creation, I'm honestly not sure. Just asked the team that worked on this component, so I'll get back to you once I hear back from them!

Hi there @victoria, @dcartlidge
I'm pretty new to retool and I have issues with creating an event by "create event" handler in the calendar. Namely, the selectedInterval.end property returns invalid date.

I'm loading both the start and end times into Postresql (time data type), by the following code:
TO_TIMESTAMP({{ calendar1.selectedInterval.end }}, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')::time

Also my query keeps timing out around 10-11 seconds, even though it is set to time out at 120 secs.

p.s.: dragging an event from bottom up switches up the end and start times. I think it is a bug.

Any ideas? Thank you in advance.

Hey @Lajos_Fidy! Happy to help here.

So it sounds like selectedInterval.end isn't working in your postgres query? Do you know what format your postgres column expects?

Also, @yuning1207, it looks like this is supported now! Is it working as you expect it to work? :slight_smile: