Skip to content

Commit

Permalink
Merge pull request #93 from edenia/revert-86-dev
Browse files Browse the repository at this point in the history
Revert "feat(components): changed date format UTC"
  • Loading branch information
AngeloCG97 authored Mar 28, 2023
2 parents 4f90994 + 56b6d68 commit 046220e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ElectionScheduleSegment = () => {
turn into an epic watch party that you might not want to miss!
</Text>
<Text type="info">
All times are UTC ({electionDates.startDateTime})
All times are local ({electionDates.startDateTime.format("z")})
</Text>
<Schedule>
<ScheduleEntry timeUtc="12:00">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export const ParticipationCard = ({ election }: Props) => {
}

const electionDate = electionDates.startDateTime.format("LL");
const electionStartTime = `${electionDates.startDateTime.format("LT")} UTC`;
const electionParticipationLimitTime = `${electionDates.participationTimeLimit.format(
"LLL"
)} UTC`;
const electionStartTime = electionDates.startDateTime.format("LT z");
const electionParticipationLimitTime = electionDates.participationTimeLimit.format(
"LLL z"
);

const isPastElectionParticipationTimeLimit = dayjs().isAfter(
electionDates.participationTimeLimit
Expand Down
5 changes: 1 addition & 4 deletions packages/webapp/src/elections/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import dayjs, { Dayjs } from "dayjs";
import utc from "dayjs/plugin/utc";

dayjs.extend(utc);

import { ActiveStateConfigType, SimpleVoteData } from "./interfaces";
import { getMemberGroupFromIndex } from "./api";
Expand All @@ -16,7 +13,7 @@ export const extractElectionDates = (election: any) => {
throw new Error("Error parsing the Election start date.");
}

const startDateTime = dayjs(rawStartDateTime).utc();
const startDateTime = dayjs(rawStartDateTime);
const participationTimeLimit = startDateTime.subtract(24, "hour");
const estimatedEndDateTime = startDateTime.add(
10, // TODO: estimate and calculate this value properly based on round numbers
Expand Down

0 comments on commit 046220e

Please sign in to comment.