MCPcopy Create free account
hub / github.com/evolify/dumpfun / getTimeColor

Function getTimeColor

common/utils/color.ts:15–27  ·  view source on GitHub ↗
(time: string)

Source from the content-addressed store, hash-verified

13}
14
15export function getTimeColor(time: string) {
16 const diff = Date.now() - new Date(time).getTime()
17 const HOUR = 1000 * 60 * 60
18 if (diff < HOUR) {
19 return "text-great"
20 } else if (diff < HOUR * 24) {
21 return "text-good"
22 } else if (diff < HOUR * 24 * 3) {
23 return "text-early"
24 } else {
25 return "text-average"
26 }
27}

Callers 1

DataTableFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected