Field validation

I have a field on a layout used for the start time of an event.

The format for field is set to
elements.start_time.format = ‘hh:mm a’;

With the new validation in 3.5.3+, no matter what I type in this field, Servoy keeps it red and refuses to let me leave the field.

For example, typing:
01:00 PM - fails
01:00 pm - fails
01:00 p - fails

I’m sure I’m doing something simple wrong, but it eludes me.

Thanks in advance for your help.

Have you tried to also set the edit mask? What happens if you do

elements.start_time.format = 'hh:mm a|hh:mm a'; 

?

That also fails.

And if you set that format directly on the field in design mode? That also fails?

Works fine for me

Mac
Java 1.6
svy 3.5.4

Not sure I fully understand what was wrong, but this is what I did to correct the problem:

  • I followed Patrick’s suggestion and applied the format for the field in Design mode. There was only a selection of date with time, none for time only, but I did it anyway, and found it worked when tested (data could now be changed in the field and validation did not fail)

  • I then removed the format for the field in design mode, and set the format using the exact same method again with the format string ‘hh:mm a’ string. Now it works.

Using Servoy 3.5.5 on Windows if that matters.

Glad it is now working. Thanks to all.