diff --git a/client/src/components/trans-routes/RouteEdit.js b/client/src/components/trans-routes/RouteEdit.js index 2a29bfa..3277e09 100644 --- a/client/src/components/trans-routes/RouteEdit.js +++ b/client/src/components/trans-routes/RouteEdit.js @@ -208,7 +208,10 @@ const RouteEdit = () => { let data = Object.assign({}, currentRoute, {name: routeName, driver: newDriver, vehicle: newVehicle, type: newRouteType, route_customer_list: stabilizedCustomerList}); if (estimatedStartTime && estimatedStartTime !== '') { - data = Object.assign({}, data, {estimated_start_time: combineDateAndTime(currentRoute.schedule_date, estimatedStartTime)}) + data = Object.assign({}, data, {estimated_start_time: combineDateAndTime(currentRoute.schedule_date, estimatedStartTime)}); + } else { + // Explicitly clear persisted value when user removes estimated start time. + data = Object.assign({}, data, {estimated_start_time: null}); } let payload = { id: currentRoute?.id, data }; if ((historyRoutes.find(item => item.id === params.id)) || (scheduleDate && new Date(data.schedule_date) > new Date())) {