Closed thomasrstorey closed 8 years ago
The value returned from your first example should be the options for the date validator meaning it should be an object with options, see which ones that are available here: http://validatejs.org/#validators-datetime
Ah I see. Thanks for clearing that up!
In the documentation, it states "validate.js allows the validators object and validator options to be a function that should return the constraints/options".
I am trying to make a Date Range field that will correctly validate ranges where the start is after the end, or the end is before the start, as invalid. I have implemented an
earliest
option on a date constraint for my date_end field as follows:Additionally I have defined a
parse
function on the validator as follows:However on inspection, I find that the value getting passed to my
parse
function is not the return value of the above function, but the function object itself, which is evaluated by+moment.utc
asNaN
Shouldn't my parse be getting the return value of myearliest
function instead of the function itself? This seems to be what is described in the documentation.Thanks for a great library otherwise!