diff options
author | T <t@tjp.lol> | 2025-08-06 16:56:46 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-07 08:33:49 -0600 |
commit | 4843deb9cfa6d91282c5124ec025c636137e9e94 (patch) | |
tree | 180dc226e7dcdbbba8ea6ecabba821f4bdb64949 /internal/tui/history_box.go | |
parent | d75bd93385bf3b54ada84c3d45011d7f8efc1f80 (diff) |
Enhanced date range parsing with more flexible input formats
- Added support for 'this week' and 'this month' date ranges
- Added support for month names (e.g., 'february', 'july') with automatic year detection
- Added support for 'month year' format (e.g., 'july 2023', 'feb 2022')
- Enhanced help text and examples for all report commands
- Added comprehensive test coverage for date range parsing
- Fixed timezone handling in TUI history display
- Minor code style improvements
Diffstat (limited to 'internal/tui/history_box.go')
-rw-r--r-- | internal/tui/history_box.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/tui/history_box.go b/internal/tui/history_box.go index 799947d..847b4fc 100644 --- a/internal/tui/history_box.go +++ b/internal/tui/history_box.go @@ -96,7 +96,7 @@ func (m *HistoryBoxModel) regenerateSummaries( if entry.ProjectID.Valid { projectID = entry.ProjectID.Int64 } - return HistorySummaryKey{dateOnly(entry.StartTime), entry.ClientID, projectID} + return HistorySummaryKey{dateOnly(entry.StartTime.Local()), entry.ClientID, projectID} }) for key, entries := range m.entries { @@ -109,7 +109,7 @@ func (m *HistoryBoxModel) regenerateSummaries( } item := HistorySummaryItem{ - Date: key.Date, + Date: key.Date.Local(), ClientID: key.ClientID, ClientName: clientNames[key.ClientID], TotalDuration: totalDur, @@ -285,7 +285,7 @@ func (m HistoryBoxModel) renderSummaryView(timer TimerBoxModel) string { func (m HistoryBoxModel) selectedEntries() []queries.TimeEntry { summary := m.summaryItems[m.summarySelection] key := HistorySummaryKey{ - Date: summary.Date, + Date: summary.Date.Local(), ClientID: summary.ClientID, } if summary.ProjectID != nil { @@ -362,7 +362,7 @@ func (m HistoryBoxModel) formatSummaryTitle(summary HistorySummaryItem) string { if summary.ProjectID != nil { return fmt.Sprintf("%s / %s", summary.ClientName, *summary.ProjectName) } - return fmt.Sprintf("%s", summary.ClientName) + return summary.ClientName } func dateOnly(t time.Time) time.Time { |