diff --git a/frontend/src/Components/View_Saved_Timesheets_Page/TimesheetCard.js b/frontend/src/Components/View_Saved_Timesheets_Page/TimesheetCard.js index 8b062525..57bfad52 100644 --- a/frontend/src/Components/View_Saved_Timesheets_Page/TimesheetCard.js +++ b/frontend/src/Components/View_Saved_Timesheets_Page/TimesheetCard.js @@ -8,7 +8,21 @@ export default function TimesheetCard(props) { const [hasResubmitted, setHasResubmitted] = useState(false) function resubmitTimesheet() { - if (hasResubmitted != true) { + var newStartTimeDate = new Date() + var newEndTimeDate = new Date() + + const [newStartHours, newStartMins, newStartSecs] = newStartTime.split(":").map(Number) + const [newEndHours, newEndMins, newEndSecs] = newEndTime.split(":").map(Number) + + newStartTimeDate.setHours(newStartHours) + newStartTimeDate.setMinutes(newStartMins) + newStartTimeDate.setSeconds(newStartSecs) + + newEndTimeDate.setHours(newEndHours) + newEndTimeDate.setMinutes(newEndMins) + newEndTimeDate.setSeconds(newEndSecs) + console.log(newStartTimeDate, newEndTimeDate, newStartTimeDate