MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatAnthropicTimeRemaining

Function formatAnthropicTimeRemaining

packages/arctic/src/provider/usage.ts:688–704  ·  view source on GitHub ↗
(resetsAt: number)

Source from the content-addressed store, hash-verified

686 }
687
688 function formatAnthropicTimeRemaining(resetsAt: number): string {
689 const now = Date.now()
690 const resetTime = resetsAt * 1000
691 const diff = resetTime - now
692
693 if (diff <= 0) return "resetting soon"
694
695 const totalMinutes = Math.floor(diff / 60000)
696 const hours = Math.floor(totalMinutes / 60)
697 const minutes = totalMinutes % 60
698 const days = Math.floor(hours / 24)
699 const hoursInDay = hours % 24
700
701 if (days > 0) return `${days}d ${hoursInDay}h left`
702 if (hours > 0) return `${hours}h ${minutes}m left`
703 return `${minutes}m left`
704 }
705
706 function getTimeFilter(period: TimePeriod, now: number): (timestamp: number) => boolean {
707 switch (period) {

Callers 1

formatAnthropicUsageRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected