Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(govern): change formatting to local time #118

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed we display null% for users with no veOLAS, quickly fixed

? '0%'
: `${getTotalVotesPercentage(votingPower, totalSupply)}%`
}
Expand Down
Loading