You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import isRideInPast from "../../../src/common/util"
if(isRideInPast(req.body)){
res.status(500).json({ status: 'Error please make sure date is valid' });
}
Frontend validation:
if(moment(rideFromState.pickupTimeAndDate).isBefore(moment.now())){
this.setState({
updatingError: new Error('Invalid Date and time'),
});
return window.alert("You can't create ride in the past")
}
The text was updated successfully, but these errors were encountered:
When Creating a ride details, the date and/or time of the ride can not be in the past.
Proposed solution:
Backend validation: here
Frontend validation:
The text was updated successfully, but these errors were encountered: