Skip to content

Commit

Permalink
Fix timestamp type
Browse files Browse the repository at this point in the history
  • Loading branch information
sofvanh committed Jan 10, 2025
1 parent 4883f19 commit 6177f52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/db/getTimestamp.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export function getTimestamp(id: string): Date {
export function getTimestamp(id: string): number {
const parts = id.split('_');
if (parts.length !== 2) {
throw new Error('Invalid ID format');
}

const timestampBase36 = parts[1].slice(0, -6);
const timestamp = parseInt(timestampBase36, 36);
return new Date(timestamp);
return timestamp;
}

0 comments on commit 6177f52

Please sign in to comment.