Closed jjavierdguezas closed 5 years ago
Sorry, I figure it out:
this.validateIf((o) => o)
.fulfills((o) => o.startDate < o.endDate)
.when((o) => o.startDate != null && o.endDate != null)
.withFailureMessage('startDate must be before endDate');
for example:
startDate: Date
andendDate: Date
both need to be aDate
but alsostartDate < endDate
but I can't find anything like:this.validateIfDate((o) => o.startDate).isBefore((o) => o.endDate)
The methodisBefore
needs aDate
, so maybe if I access to the current validating object, but I dont know how?