32
Views
5
Comments
How to detect whether a user has selected a time when 00:00 is treated as NullTime?
Discussion

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?

2026-06-20 17-43-43
Sherif El-Habibi
Champion

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. 

2024-10-05 13-30-20
Huy Hoang The

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.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
  • using a Time Picker component will not magically make the system distinguish between 00:00 and not chosen. After user left the widget and/or screen, both will be treated the same.
  • There is no need for the Time Picker widget to be able to get a mandatory validation triggered, that works both on an input and the time picker widget, just set it as mandatory and make built-in validations run.
2024-10-05 13-30-20
Huy Hoang The

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. 

2023-06-13 12-29-43
Sakthivel P

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.