Skip to content

Commit

Permalink
Merge pull request #118 from valory-xyz/tanya/proposals-local-time
Browse files Browse the repository at this point in the history
(govern): change formatting to local time
  • Loading branch information
DavidMinarsch authored Oct 18, 2024
2 parents 7042a1c + e89c8f3 commit 8b5bbee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions apps/govern/common-util/functions/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ export function getFormattedDate(ms: number): string {

/**
* Get formatted date from milliseconds including time
* example, 1678320000000 => Mar 09 '2023 16:00
* example, 1678320000000 => Mar 09 '2023 16:00 (local time)
*/
export function getFullFormattedDate(ms: number): string {
if (ms == 0) return NA;

const date = new Date(ms);
const month = MONTHS[date.getMonth()];
const day = date.getUTCDate();
const year = date.getUTCFullYear();
const hours = date.getUTCHours();
const minutes = date.getUTCMinutes();
const day = date.getDate();
const year = date.getFullYear();
const hours = date.getHours();
const minutes = date.getMinutes();

return (
month +
Expand Down
2 changes: 1 addition & 1 deletion apps/govern/components/VeOlas/VeOlasComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const VotingPercentComponent = ({
isLoading={isLoading}
title="% of total voting power"
value={
Number(votingPower) === 0 || Number(totalSupply) === 0
votingPower === undefined || Number(votingPower) === 0 || Number(totalSupply) === 0
? '0%'
: `${getTotalVotesPercentage(votingPower, totalSupply)}%`
}
Expand Down

0 comments on commit 8b5bbee

Please sign in to comment.