Skip to content

Commit ad6d7bd

Browse files
committed
feat: show days in reset time when exceeds 24 hours
1 parent b387161 commit ad6d7bd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [v2.2.3] Improved Reset Time Display
6+
7+
### Changed
8+
- **Reset Time Display**: Show "1d 2h" instead of "26h 33m" when reset time exceeds 24 hours for better readability
9+
10+
---
11+
512
## [v2.2.2] Documentation Improvements
613

714
### Changed

internal/display/formatter.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,14 @@ func formatResetTime(resetTimeStr string) string {
241241
exactTime := localResetTime.Format("15:04")
242242

243243
// Format as relative time with exact time
244-
hours := int(diff.Hours())
244+
totalHours := int(diff.Hours())
245+
days := totalHours / 24
246+
hours := totalHours % 24
245247
minutes := int(diff.Minutes()) % 60
246248

249+
if days > 0 {
250+
return fmt.Sprintf("%dd %dh (%s)", days, hours, exactTime)
251+
}
247252
if hours > 0 {
248253
return fmt.Sprintf("%dh %dm (%s)", hours, minutes, exactTime)
249254
}

0 commit comments

Comments
 (0)