demandsolution-codex / lib /hot-score.ts
Jacksuyu's picture
Initial release: Demand Solution Board v0.1
60e766b
Raw History Blame Contribute Delete
197 Bytes
export function scoreHot(upvotes: number, createdAt: Date): number {
const ageHours = Math.max(1, (Date.now() - createdAt.getTime()) / 3600000);
return upvotes / Math.pow(ageHours + 2, 0.8);
}