Skip to content

feat(reset-timer): show local timezone clock time alongside countdown (#34)#37

Merged
guyinwonder168 merged 1 commit into
mainfrom
fix/reset-timer-timezone-34
Jun 15, 2026
Merged

feat(reset-timer): show local timezone clock time alongside countdown (#34)#37
guyinwonder168 merged 1 commit into
mainfrom
fix/reset-timer-timezone-34

Conversation

@guyinwonder168

Copy link
Copy Markdown
Owner

Summary

Resolves #34

The reset timer previously showed only a countdown (4h 36m), leaving users in far-from-UTC timezones unable to tell when resets actually occur. This PR adds the local clock time alongside the countdown.

Changes

Output Format

Before:

| ⏱️ 5h Token | 87.0% | ████████████████░░░░░ | 4h 36m |
| 📅 Weekly   | 17.0% | ████░░░░░░░░░░░░░░░░ | 6d 16h |

After:

| ⏱️ 5h Token | 87.0% | ████████████████░░░░░ | 4h 36m (01:34) |
| 📅 Weekly   | 17.0% | ████░░░░░░░░░░░░░░░░ | 6d 16h (Sat 13:48) |

Implementation

  • formatResetCell() in src/index.ts uses native Date methods (getHours(), getMinutes(), getDay())
  • Short durations (<24h): 4h 36m (HH:MM)
  • Long durations (≥24h): 6d 16h (Day HH:MM)
  • No timezone abbreviations (unreliable in Node.js across platforms — user knows their own TZ)

Testing (TDD)

  • Integration tests updated to use assert.match() with regex patterns for timezone-independent matching
  • Pattern: /\d{2}:\d{2}/ for short, /[A-Z][a-z]{2} \d{2}:\d{2}/ for long durations
  • 117 tests passing, 0 failures

Documentation

  • New: docs/implementation-plan-v1.8.0.md
  • Updated: CHANGELOG.md, README.md, docs/opencode-glm-quota-prd-final.md (Section 1.12)
  • Updated: AGENTS.md — added KISS/YAGNI/TDD/No-Over-Thinking development principles

Version

  • 1.7.01.8.0 (MINOR — new user-visible feature)

Design Decisions (KISS + YAGNI)

Decision Choice Why
TZ abbreviation Not included toLocaleTimeString TZ names unreliable across platforms
Time API Native Date methods No dependencies, follows existing date-formatter.ts pattern
Test strategy Regex assertions Deterministic across CI environments (defaults to UTC)

Checklist

  • TypeScript builds clean
  • ESLint passes (0 errors)
  • All 117 tests pass
  • CHANGELOG updated
  • README output example updated
  • PRD Section 1.12 added
  • Version bumped in package.json + sonar-project.properties

…#34)

- formatResetCell() now appends local HH:MM for short durations
- Long durations (>=24h) show weekday + HH:MM (e.g., Sat 13:48)
- Integration tests use regex assertions for timezone-independent matching
- Bump version 1.7.0 -> 1.8.0
- Add KISS/YAGNI/TDD/No-Over-Thinking principles to AGENTS.md
- Resolves #34
@sonarqubecloud

Copy link
Copy Markdown

@guyinwonder168 guyinwonder168 merged commit 0f8b314 into main Jun 15, 2026
17 checks passed
@guyinwonder168 guyinwonder168 deleted the fix/reset-timer-timezone-34 branch June 15, 2026 05:37
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.

Display actual reset timestamp in local timezone (not just countdown)

1 participant