Skip to content

feat: add time_format config option for 12h AM/PM timestamps - #25

Closed
josemoreno801-netizen wants to merge 1 commit into
Digital-Process-Tools:mainfrom
josemoreno801-netizen:feat/time-format-config
Closed

josemoreno801-netizen wants to merge 1 commit into
Digital-Process-Tools:mainfrom
josemoreno801-netizen:feat/time-format-config

Conversation

@josemoreno801-netizen

Copy link
Copy Markdown
Contributor

Introduces a new top-level time_format config key that controls timestamp style in save-session output:

  • "24h" (default, backward compatible) — produces 14:32
  • "12h" — produces 2:32 PM

Changes

  • config.example.json: add "time_format": "24h" default
  • scripts/save-session.sh: read config, branch between %H:%M and %-I:%M %p
  • scripts/save-session.sh: widen format-validation regex to accept both formats
  • README.md: document the new key in the Configuration table

Compatibility

No behavior change for existing users — the default preserves 24h output.

Testing

  • scripts/run-tests.sh passes locally on the branch
  • Manually verified both time_format: "24h" and time_format: "12h" produce correctly-formatted headers that pass the updated validation regex

Introduces a new top-level `time_format` config key that controls the
timestamp style in save-session output and, by extension, the downstream
today-*.md and recent.md files:

- "24h" (default, backward compatible) — produces `14:32`
- "12h" — produces `2:32 PM`

Changes:
- config.example.json: add "time_format": "24h" default
- scripts/save-session.sh: read config, branch between %H:%M and %-I:%M %p
- scripts/save-session.sh: widen format-validation regex to accept both
- README.md: document the new key in the Configuration table

No behavior change for existing users — the default preserves 24h output.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@fdaviddpt fdaviddpt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean feature, well-scoped. The 12h/24h config option is backward compatible (defaults to 24h) and the validation regex update correctly handles both formats.

Verified that %-I (no-pad hour) works on both macOS BSD date and GNU date, so no portability issue there.

One heads-up: main has changed since this PR was opened — #33 modified save-session.sh (mktemp extensions removed) and config.example.json may need a rebase. The conflict should be trivial to resolve.

Thanks @josemoreno801-netizen for the clean contribution — this is exactly the kind of user-facing config option that makes the plugin feel polished. The commit is focused, the default is safe, and the regex update shows attention to detail.

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closing in favor of #34 which implements the same feature on current main with 10 tests covering config, format output, regex validation, and edge cases.

Thank you @josemoreno801-netizen for the clean feature design! The 12h/24h config option, the backward-compatible default, and the regex update all made it into the final implementation. Your approach was spot on — we just needed to rebase onto the latest main and add test coverage. You've now contributed to three merged features in this project (time format, BSD mktemp, and the timezone investigation). Really appreciate the sustained engagement!

fdaviddpt added a commit that referenced this pull request Apr 25, 2026
feat: add time_format config option for 12h AM/PM timestamps
@fdaviddpt fdaviddpt closed this Apr 25, 2026
Bunshin-v2 pushed a commit to Bunshin-v2/claude-remember that referenced this pull request Apr 26, 2026
Introduces a top-level time_format config key controlling timestamp
style in save-session output:

- "24h" (default, backward compatible) — produces 14:32
- "12h" — produces 2:32 PM

Changes:
- save-session.sh: read time_format config, use %-I:%M %p for 12h
- save-session.sh: expand header validation regex to accept both formats
- config.example.json: document new option with 24h default
- 10 new tests: config presence, format output, regex acceptance for
  24h/12h/AM/PM/double-digit, rejection of garbage, default fallback

Inspired by josemoreno801-netizen's PR Digital-Process-Tools#25. Supersedes Digital-Process-Tools#25.

Co-Authored-By: Max <noreply>
@josemoreno801-netizen
josemoreno801-netizen deleted the feat/time-format-config branch April 27, 2026 03:20
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.

2 participants