requestsolution / lib /hot-score.ts
Jacksuyu's picture
Claude Opus 4.6
Initial release: Community Demand Board V0.1
8e944c6
Raw History Blame Contribute Delete
212 Bytes
export function hotScore(upvotes: number, createdAt: Date): number {
const ageInHours =
(Date.now() - createdAt.getTime()) / (1000 * 60 * 60);
return Math.log10(Math.max(upvotes, 1)) - ageInHours / 24;
}