Repository navigation
feat: add time_format config option for 12h AM/PM timestamps - #25
josemoreno801-netizen wants to merge 1 commit into
Conversation
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
left a comment
There was a problem hiding this comment.
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.
|
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! |
feat: add time_format config option for 12h AM/PM timestamps
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>
Introduces a new top-level
time_formatconfig key that controls timestamp style in save-session output:"24h"(default, backward compatible) — produces14:32"12h"— produces2:32 PMChanges
config.example.json: add"time_format": "24h"defaultscripts/save-session.sh: read config, branch between%H:%Mand%-I:%M %pscripts/save-session.sh: widen format-validation regex to accept both formatsREADME.md: document the new key in the Configuration tableCompatibility
No behavior change for existing users — the default preserves 24h output.
Testing
scripts/run-tests.shpasses locally on the branchtime_format: "24h"andtime_format: "12h"produce correctly-formatted headers that pass the updated validation regex