Set Date Range to Always Be 30 Days Apart

Hey all! As the title suggests, I'm trying to figure out some way to have the date range component always be 30 days apart. So, the user selects a start date, and the end date is coded as 30 days after that, and cannot be changed.

I can't seem to reference the components start date in the end date field, as it won't recognize 'self' or even the direct reference of 'dateRange1.value.start'.

Hey Shane,

You can accomplish this functionality as shown in example.

Additionally, you can use self.value.start instead of the component name.

If you try picking any date for end it reverts back to 30 days from start date.

Hope it helps!


I appreciate the response! That definitely helps to see it function. I orignally kind of tried that, but when Retool noted that neither 'self' nor 'dateRange1' were defined when referenced in the component, I gave up before looking if it actually worked, and came here haha.

Thanks for your help!

1 Like