Issue
I was given a tool to connect data reporting from SQL DB to HubSpot. I needed to add buttons to change the dates of two datepickers in the app when clicked. However, I am not familiar with JavaScript. I want to know if it's possible to assign dates automatically with a single click on the button. The layout is shown in the picture.
Resolution
The task at hand is to add buttons to an Appsmith app that will change the date range in two datepicker widgets.
To calculate the dates by adding or subtracting a number of days, you can use the momentJS library. The storeValue() method can be used to update the default date of the DatePicker widgets with the calculated values. We have a sample app that demonstrates how to dynamically set the date in a DatePicker widget, and another sample app that demonstrates how to calculate dates based on the selected date.