Backendless Support
 
In Progress

"Value does not match the chosen validator" (datetime)

I live in Europe and I suspect that is the reason the datetime validation doesn't work for us in console.

As you can see I tried both: UTC and 24h time format and without UTC and time below 12h.

All I have to do is try to select the date and time from the presented dialog in console (with datetime validator ON) and I receive the above error.

49f0abcd984ad61bd32c72624f964b8b

d428004686f3a195bf81cae8ed16fe3f

Best Answer
photo

OK, I understand your motivation. It looks like earlier we had more exact predefined validators for datetime columns, like "Date: dd/mm/yy" or "Date: dd/mm/yyyy GMTx" etc., but apparently they were removed (or merged somehow) since it was unreasonable to keep a possibly large list of such formats predefined. Current generic "Date/Time" validator may be ambiguous - it is not clear what exactly it validates and you would actually be terrified if you had seen the regex for that :)

Considering that for DATETIME columns the date values are already validated on saving, I believe having a separate "Date/Time" validator is not correct - it is only useful for string-like columns, but we shouldn't encourage keeping date/time values in such columns. So I think this validator will simply be removed eventually, as a solution.

And in your specific case it's merely redundant, so I suggest you to safely remove the validator.

Leave a Comment

Comments (4)

photo
1

Hi Jure,

Thank you for pointing this out, it is definitely a bug and we shall discuss probable solutions internally.

But first, why do you need this kind of validator on a datetime column?

photo
1

I thought it to be a nice additional safety tool for moments when datetime formats go wrong.

The validator already exists there so I thought it would be good to run well.

How I found it:

I am currently changing a few things for my event planner android app that uses date and time options. I am making it Timezone aware as well and while toying a little bit with the console I found this bug.

I remember founding it previously, when I first start developing the app and since I didn't report it then I thought it would be best to do so now.

photo
1

OK, I understand your motivation. It looks like earlier we had more exact predefined validators for datetime columns, like "Date: dd/mm/yy" or "Date: dd/mm/yyyy GMTx" etc., but apparently they were removed (or merged somehow) since it was unreasonable to keep a possibly large list of such formats predefined. Current generic "Date/Time" validator may be ambiguous - it is not clear what exactly it validates and you would actually be terrified if you had seen the regex for that :)

Considering that for DATETIME columns the date values are already validated on saving, I believe having a separate "Date/Time" validator is not correct - it is only useful for string-like columns, but we shouldn't encourage keeping date/time values in such columns. So I think this validator will simply be removed eventually, as a solution.

And in your specific case it's merely redundant, so I suggest you to safely remove the validator.

photo
1

Will do. Thank you

photo