Time formatting based on Date and Time Custom (HH:mm) type
I have a field on a model lets call it startOfDay and it has the mendix derived type of “Date and Time” this field is used with a date and time picker input using custom formatting. 00:00 is valid when you enter it into the input 0000 is invalid. The problem arises when you get a response with the value 00:00 and need to assign it to startOfDay. You get the following error: ”The microflow expression is of type string but should be of type Date and time” The error is self explanatory and some formatting may be needed to achieve that, but how? Please I have looked at Parse & Format Date Function Calls and still no clue how this can be achieve in mendix the mendix way. 00:00 is straight forward start of the day. but if values came back as 13:30, 15:21, need to format each and pass it to the model and then display that value in the date and time picker input field. Is there away to achieve with without the need to write extra logic or does one need to turn the date and time type to string and come up custom validation to meet this?
Mathew P A
Hi Mathew, even though a date picker with a custom date format is editable, I would suggest to add the startDay attribute twice to your page. The first time to pick the date (choose format date) and second to pick the time (choose format time). Does that meet your use case or?