Skip to content

Commit

Permalink
[Creation Date] Workaround unpredictable IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
roj1512 committed Apr 25, 2024
1 parent ab5fdc0 commit 2a9ff1d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/creation_date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function predictCreationDate(id: number) {
if (r <= 0) return now();
const d = new Date(r * 1_000);
if (isNaN(d.getHours())) return now();
if (d.getFullYear() < 2013) return now();
return d;
}
function now() {
Expand Down

0 comments on commit 2a9ff1d

Please sign in to comment.