Clear out invalid date from date picker

0
Hello,   I am working with both the Mendix Date Picker and the react date time picker and I am not able to reset the Date picker when the input value is invalid.    The scenario is as follows:  The user answers a question with a Yes or No radio button.  If the answer is Yes then a date time picker appears. If a user types in an invalid date and then clicks or tabs out an invalid validation message appears. If the user then decides to switch their answer from Yes to No the date time picker disappears. The user will then switch their answer back to Yes and the date time picker will reappear again, but this time the invalid date is still remaining in the input box.    I have tried to use a microflow to set the input value of the date picker to empty, but that has no impact on the invalid date. If the date happen to be valid, I am able to use a microflow to set the value to empty.    Is there a way to clear out an invalid date from the date picker? 
asked
2 answers
1

Hi Matthew,

 

When you are calling the microflow after the event switch from Yes to No, are you enabling a refresh on the object before you hide it?

answered
1

hi Matthew Mangiaracina,

In this case i would handle my invalid date calculation in the microflow and set the date to empty and refresh the object. I guess you can use onchange microflow in react-datetime picker.

In your microflow check first if the date is empty and then check if the date is invalid , if yes, set the date attribute to empty and if valid , leave it as it is.
Hope it helps. 

answered