-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dde2147
commit 3e952ef
Showing
7 changed files
with
58 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { DateTime } from "luxon"; | ||
|
||
export const epochToString = (epoch: bigint): string => | ||
`Epoch ${epoch.toString()}`; | ||
|
||
export const secondsToDateTime = (seconds: bigint): DateTime => | ||
DateTime.fromSeconds(Number(seconds)); | ||
|
||
export const secondsToTimeString = (seconds: bigint): string => | ||
secondsToDateTime(seconds).toLocaleString(DateTime.TIME_SIMPLE); | ||
|
||
export const secondsToDateString = (seconds: bigint): string => | ||
secondsToDateTime(seconds).toLocaleString(DateTime.DATE_MED); | ||
|
||
export const secondsToDateTimeString = (seconds: bigint): string => | ||
`${secondsToDateString(seconds)}, ${secondsToTimeString(seconds)}`; | ||
|
||
export const secondsToFullDateTimeString = (seconds: bigint): string => | ||
secondsToDateTime(seconds).toLocaleString(DateTime.DATETIME_FULL); | ||
|
||
export const secondsToTimeRemainingString = ( | ||
startTimeInSeconds: bigint, | ||
endTimeInSeconds: bigint | ||
): string => | ||
secondsToDateTime(endTimeInSeconds) | ||
.diff(secondsToDateTime(startTimeInSeconds), ["days", "hours", "minutes"]) | ||
.toHuman(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3e952ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://namada-interface-dev.netlify.app as production
🚀 Deployed on https://67697c32d3b3407d05bb7e11--namada-interface-dev.netlify.app