Hi everyone,
I’m facing an issue with a Time Input (24-hour format) in OutSystems in both Mobile and Webapp and would appreciate your help.
Problem description
The input type is Time
The field is marked as Required
When the user selects 00:00, OutSystems internally treats this value as NullTime()
Because of that, it’s impossible to distinguish between:
❌ The user did not select any time
✅ The user selected 00:00
I’m currently using manual validation to display the “This field is required” message.
Question
👉 Is there a way to reliably detect whether the user has actually selected a time, even when the selected value is 00:00?
Hello,
Have you tried using the Time Picker block from OutSystems UI? It can achieve the desired approach and offers flexibility in choosing between 24-hour and 12-hour formats. It also includes built-in validation, so for example, selecting 00:00 in the 24-hour format does not trigger the same validation issues you might encounter with a standard input.
Hi Tuan Duong,
Because Default Value of Type Time is "00:00:00" so if u chose 00:00, so the system will treat it as null.
I recommend u use Time Picker Component to config setting for Time Input and handle change events.
Thank Dorine, I know this, Time Picker will not distinguish between default values or user selects. We need to create a flag (TimeIsChanged) to indicate that it has been selected.
I'm only recommending Time Picker because it has many preset settings for time types.
Hi @Tuan Duong,
As mentioned by community members, it is necessary to implement a custom validation similar to the OnChange or OnSelected actions of the TimePicker widget. This can be achieved by creating a flag variable, such as HasSelectedTime, which can be set to true within the respective action.