This question was posted by one of our users on Discord. We’ve made a sample app to demonstrate how we can perform differences on two dates from DatePicker widgets using the moment library.
This thread demonstrates how to find the difference between two dates using two Date Picker widgets on Appsmith.
Live Sample App: Appsmith
How to Build This App?
-
Add two Date Picker widgets.
-
Choose the default dates or add dates dynamically to perform difference operation.
-
Drag and drop a text widget, or widget of your preference to display the difference.
-
Use
moment(DatePicker2.selectedDate).diff(DatePicker1.selectedDate, "days")
to perform the operation.