Skip to content

feat: Support --date flag for tmpo log and tmpo stats#104

Merged
DylanDevelops merged 1 commit intomainfrom
ravel/date-flag-on-log-and-stats
Mar 31, 2026
Merged

feat: Support --date flag for tmpo log and tmpo stats#104
DylanDevelops merged 1 commit intomainfrom
ravel/date-flag-on-log-and-stats

Conversation

@DylanDevelops
Copy link
Copy Markdown
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Closes #91

Description

This pull request adds support for filtering history logs and statistics by a specific date in both the log and stats commands. It introduces a new --date (or -d) flag, allowing users to view entries or stats for a user-specified date. The implementation also includes logic to handle different date formats based on user configuration.

New date filtering functionality:

  • Added a --date (-d) flag to both the log and stats commands to allow filtering entries or statistics for a specific date (cmd/history/log.go, cmd/history/stats.go). [1] [2] [3] [4]

Command logic updates:

  • Updated the log command to check for the logDate flag and retrieve entries within the specified date range using the new flag (cmd/history/log.go).
  • Updated the stats command to check for the statsDate flag and compute statistics for the specified date, displaying the date in a user-friendly format (cmd/history/stats.go).

Date parsing improvements:

  • Implemented a parseDateFlag helper function to parse the date input according to the user's configured date format, with fallback and error messaging (cmd/history/log.go).

These changes improve usability by allowing users to easily filter logs and stats by any date, not just today or this week.

@DylanDevelops DylanDevelops merged commit 1c1228a into main Mar 31, 2026
5 checks passed
@DylanDevelops DylanDevelops deleted the ravel/date-flag-on-log-and-stats branch March 31, 2026 08:39
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.

Extend tmpo log and tmpo stats to filter on date

1 participant