I have this joi validation schema
requiredInceptionDate: Joi.date().format("DD/MM/YYYY").raw(),
requiredExpiryDate: Joi.date()
.format("DD/MM/YYY")
.raw()
.min(Joi.ref("requiredInceptionDate")),
however I get this error
Error: ValidationError: "requiredExpiryDate" must be greater than or equal to "ref:requiredInceptionDate"
the file I’m processing has
"requiredInceptionDate":"01/09/2021",
"requiredExpiryDate":"30/10/2022",
All i can think of is perhaps it doesn’t like the fact it’s a string? But that’s why I used raw()