11
Views
2
Comments
Solved
Reactive Datepicker Max Date is getting selected

Hi All,


So I have a two datepicker namely Start Date and End Date. So basically the max date the user can select in the Start Date field is the selected value of the End Date to avoid overlapping.



Then I set the variables to the events of the their respected datepicker widget. I Initialize the dates to be the current day as of today.


For testing, I set the Start Date to earlier date than the End Date. After that, I set the End Date say November 16, 2020.

Why is that after I set the End Date, The value of the Start Date is getting updated to the Current Date (November 17, 2020 - This is the initial date)?


Please note that the text in the Start Date input is the Current Date while if we open the Start Date Datepicker, the selected value is the selected value from the End Date Calendar.


I hope I am explaining my problem clearly. Attached is the OML file.


Thank you so much.

DatePickerWithMax.oml

Rank: #20781
Solution

I have solved it by assigning the temp variables to the InitialDate property of the date pickers.

Rank: #502

Hi,

It doesn't not work this way. When you bind the value of the temp_ToDate to the MaxDate attribute of FromDate, it just assign the value to the MaxDate, not the assign the reference. Then, every time you change the ToDate, the FromDate reinitialize with the first temp_ToDate value (which is set initialized as CurrDate())

Hope this help

Rank: #20781
Solution

I have solved it by assigning the temp variables to the InitialDate property of the date pickers.