fix: tmpo edit and tmpo manual use global config date format
#46
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.
Introduces user-configurable date formats for manual and edit time entry commands by loading the global config and adjusting prompts, validation, and parsing accordingly. Updates validation and parsing functions to accept date format parameters, and adds a helper to map config values to display and Go layouts. Updates tests to use the new function signatures.
Pull Request Checklist
mainbranch of tmpo.Description
This pull request updates the time entry commands to support user-configurable date formats throughout the manual and edit workflows. The changes ensure that date prompts, validation, and parsing all respect the user's preferred date format as set in their global configuration. This improves usability for users in different locales and prevents date format confusion. Additionally, the test suite is updated to reflect the new function signatures.
User-configurable date format support:
getDateFormatInfohelper function to map user-configured date formats to display strings and Go time layouts. This is used to dynamically set prompt labels and parsing formats. (cmd/entries/manual.gocmd/entries/manual.goL9-R34)cmd/entries/manual.go[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Validation and parsing improvements:
validateDate,validateDateOptional,validateEndDateTime, andparseDateTimeto accept a date layout and display format, ensuring all validation and parsing logic is format-aware. (cmd/entries/manual.go[1] [2] [3]cmd/entries/edit.go[4]Test updates:
cmd/entries/manual_test.go[1] [2] [3]