MCPcopy Create free account
hub / github.com/dfinity/orbit / parseDate

Function parseDate

apps/wallet/src/utils/date.utils.ts:51–59  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

49}
50
51export const parseDate = (raw: string): Date => {
52 const date = Date.parse(raw);
53
54 if (isNaN(date)) {
55 throw new Error(`Invalid date: ${date}`);
56 }
57
58 return new Date(date);
59};
60
61export function nanoToJsDate(nanoTimestamp: bigint): Date {
62 // Convert BigInt to milliseconds by dividing by 1 million

Callers 3

useSavedFiltersFunction · 0.90
useSavedFiltersFunction · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected