Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

styling :) ✨ #461

Merged
merged 7 commits into from
Dec 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
set utc since dates are stored in sql as PST, without specifying utc,…
… moment will subtract 8 hours for timezone change from utc to PST
  • Loading branch information
refcell committed Dec 4, 2020
commit 75d3ee7def9c4b6418df63f17887e4a8c5107b92
35 changes: 22 additions & 13 deletions pages/scheduleManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ const EditableCell = ({ event }) => {
const [currEvent, setCurrEvent] = useState(event);
const startTime = moment(
currEvent.startsAt,
"YYYY-MM-DDTHH:mm:ss.SSSZ"
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"UTC"
).format("hh:mm a");
const endTime = moment(
currEvent.endsAt,
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"UTC"
).format("hh:mm a");
const endTime = moment(currEvent.endsAt, "YYYY-MM-DDTHH:mm:ss.SSSZ").format(
"hh:mm a"
);

return (
<Task>
Expand Down Expand Up @@ -62,20 +65,26 @@ const EditableCell = ({ event }) => {
"MM/DD/YYYY"
) ? (
<span>
{moment(currEvent.startsAt, "YYYY-MM-DDTHH:mm:ss.SSSZ").format(
"MMM D"
)}
{moment(
currEvent.startsAt,
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"UTC"
).format("MMM D")}
, {startTime} - {endTime}
</span>
) : (
<span>
{moment(currEvent.startsAt, "YYYY-MM-DDTHH:mm:ss.SSSZ").format(
"MMM D hh:mm a"
)}{" "}
{moment(
currEvent.startsAt,
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"UTC"
).format("MMM D hh:mm a")}{" "}
-{" "}
{moment(currEvent.endsAt, "YYYY-MM-DDTHH:mm:ss.SSSZ").format(
"MMM D hh:mm a"
)}
{moment(
currEvent.endsAt,
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"UTC"
).format("MMM D hh:mm a")}
</span>
)}
</Description>
Expand Down