This commit is contained in:
commit
d554599768
11 changed files with 334 additions and 0 deletions
8
src/lib/char.ts
Normal file
8
src/lib/char.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
function timestampToReadable(timestamp?: number): string {
|
||||
const date: Date =
|
||||
timestamp && !Number.isNaN(timestamp) ? new Date(timestamp) : new Date();
|
||||
if (Number.isNaN(date.getTime())) return "Invalid Date";
|
||||
return date.toISOString().replace("T", " ").replace("Z", "");
|
||||
}
|
||||
|
||||
export { timestampToReadable };
|
Loading…
Add table
Add a link
Reference in a new issue