Skip to content

Commit

Permalink
fixed bug in ScheduleEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckadon committed Dec 14, 2023
1 parent 6cc3d86 commit 40de356
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Screens/Admin/ScheduleEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const getTime = (dateString: string, time: string) => {
let seconds =
(Number(timeParts[0]) * 60 + Number(timeParts[1])) * 60 +
Number(timeParts[2]);
if (timeParts[3] === "pm" || timeParts[3] === "PM") seconds += 12 * 60 * 60;
if (
(timeParts[3] === "pm" && Number(timeParts[0]) !== 12) ||
(timeParts[3] === "PM" && Number(timeParts[0]) !== 12)
)
seconds += 12 * 60 * 60;
return seconds;
}
dateObject.setTime(dateObject.getTime() + getSeconds(time) * 1000);
Expand Down

0 comments on commit 40de356

Please sign in to comment.