Skip to content

Commit

Permalink
add timestamp to query displayid, remove token
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktaubeneck committed Jun 8, 2024
1 parent 63088f7 commit 339699c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server/app/query/haikunator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ const haikunator = new Haikunator({
nouns: nouns,
});

function getCurrentTimestamp() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
return `${year}-${month}-${day}T${hours}${minutes}`;
}

export default function NewQueryId(): string {
return haikunator.haikunate();
return haikunator.haikunate({tokenLength: 0}) + getCurrentTimestamp();
}

0 comments on commit 339699c

Please sign in to comment.