Skip to content

feat: support absolute datetime for reset timers#220

Open
fanyu wants to merge 1 commit intosirmalloc:mainfrom
fanyu:feat/reset-timer-date-mode
Open

feat: support absolute datetime for reset timers#220
fanyu wants to merge 1 commit intosirmalloc:mainfrom
fanyu:feat/reset-timer-date-mode

Conversation

@fanyu
Copy link

@fanyu fanyu commented Mar 12, 2026

Summary

  • add a date mode (d) to both Block Reset Timer and Weekly Reset Timer
  • in date mode, render the reset point as an absolute UTC timestamp instead of a duration
  • keep existing duration/progress modes unchanged and gracefully fall back to duration if reset timestamp is unavailable

UX

  • p: cycle time/full bar/short bar (existing)
  • s: compact formatting for duration/date (existing behavior extended to date mode)
  • d: toggle absolute datetime mode (new)

Implementation

  • add formatUsageResetAt(resetAt, compact) utility
  • add shared metadata helpers isUsageDateMode / toggleUsageDateMode
  • wire date mode into both reset timer widgets and editor modifier text
  • update README docs for widget behavior and keybinds
  • add/extend tests for date mode rendering and reset timestamp formatter

Verification

  • npx tsc --noEmit && npx eslint . --config eslint.config.js --max-warnings=0
  • npx vitest run src/utils/__tests__/usage.test.ts src/widgets/__tests__/BlockResetTimer.test.ts src/widgets/__tests__/WeeklyResetTimer.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant