Repository navigation
Conversation
Adds a "timeformat_display" config key that controls how entry timestamps are shown (jrnl -1, --short/-s, search results) without affecting how they're stored. It accepts "relative" (e.g. "5 minutes ago") or a strftime format string, falling back to "timeformat" when unset. Also fixes make_yaml_valid_dict() to handle --config-override values containing "%" (e.g. strftime formats), which previously raised a YAML ScannerError since a bare "%" is a reserved YAML indicator. Closes #1721
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
timeformat_displayconfig key that controls how entry timestamps are displayed (jrnl -1,--short/-s, search results, etc.) independently of how they're stored (timeformat).relativedisplays timestamps like5 minutes ago/in 3 days.timeformat."") falls back totimeformat, so existing behavior is unchanged.make_yaml_valid_dict()so--config-override timeformat_display '%d.%m.%Y'works — it previously raised a YAMLScannerErrorbecause a bare%is a reserved YAML indicator character. This matters here since the maintainer's comment on the issue calls out config-override as a supported way to set this.Closes #1721
Test plan
poetry run poe test(lint + full suite): 720 passed, 40 skippedtests/unit/test_time.py(relative_time),tests/unit/test_parse_args.py(make_yaml_valid_dictwith%-containing values)tests/bdd/features/datetime.featurecovering config-file and--config-overridepaths,relative, custom format strings, and--short/-s