Closed IQUAYE closed 3 years ago
Yep, the regex used by the isDate utility function is accepting time only values as valid DateTimes. I'll try to adjust it to requires the date part, but not sure when i'll get this ready. Although your change is also a valid one.
Hi @IQUAYE,
I just released a new version (v1.1.9) with the fixes for this issue. Thanks you very much for your help!
Welcome @rpgkaiser, you did and are still doing a great job
I am trying to validate two time-input fields using [GreaterThan] attribute with value formatted from the server as {HH:mm}.
But the validation error message was always the same irrespective of the values I input in both fields.
Upon inspecting the mvcfoolproof.core.js, I realised such formats are parsed as dates during the call to isDate() method which gets called before the isTime() method. Eventually, the input value gets validated as a date field thereby failing the validation every time.
BTW, I made it work in my code by changing the positions of the isTime() and isDate() methods so that my time values are validated as time even before the isDate() method is called.