Add support for showing start time in 24-hour format#78
Merged
caarlos0 merged 1 commit intocaarlos0:mainfrom Sep 9, 2023
joncol:add-twentyfour-hour-start-time-format
Merged
Add support for showing start time in 24-hour format#78caarlos0 merged 1 commit intocaarlos0:mainfrom joncol:add-twentyfour-hour-start-time-format
caarlos0 merged 1 commit intocaarlos0:mainfrom
joncol:add-twentyfour-hour-start-time-format
Conversation
caarlos0
reviewed
Sep 5, 2023
main.go
Outdated
| func init() { | ||
| rootCmd.Flags().StringVarP(&name, "name", "n", "", "timer name") | ||
| rootCmd.Flags().BoolVarP(&altscreen, "fullscreen", "f", false, "fullscreen") | ||
| rootCmd.Flags().BoolVarP(&twentyFourHourStartTime, "24", "", false, "Use 24-hour format for start time") |
Owner
There was a problem hiding this comment.
maybe it would be nicer to do something like:
--format 24h
--format kitchen
etc
that way we could add more formats in the future... or even allow the user to provide their own.
wdyt?
Contributor
Author
There was a problem hiding this comment.
Yes, I thought about it, but was a bit reluctant to leak implementation-specific details such as "kitchen" meaning that specific format. But if you prefer it, I could modify the PR...
Contributor
Author
There was a problem hiding this comment.
Done, I'll squash the fixup commits before potential merge.
caarlos0
approved these changes
Sep 7, 2023
Owner
caarlos0
left a comment
There was a problem hiding this comment.
minor comment, other than that LGTM 🙏🏻
main.go
Outdated
Comment on lines
+94
to
+95
| case "kitchen": | ||
| startTimeFormat = time.Kitchen |
Owner
There was a problem hiding this comment.
can be removed, handled by default
caarlos0
approved these changes
Sep 9, 2023
Owner
|
Thank you! |
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.
Solves #55