I'm trying to validate that a certain endDate is after a startDate. I've tried everything I found and could think of but nothing works. Some examples of what I've tried:
check('endDate').isAfter(new Date('startDate')).withMessage('End date of lab must be valid and after start date')
check('endDate').isAfter(new Date('startDate').toDateString()).withMessage('End date of lab must be valid and after start date')
check('endDate').isAfter('startDate').withMessage('End date of lab must be valid and after start date')
check('endDate').isAfter(new Date('' + 'startDate').toDateString()).withMessage('End date of lab must be valid and after start date')
The docs say that isAfter() expects a string.