Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for showing start time in 24-hour format #78

Merged
merged 1 commit into from
Sep 9, 2023
Merged

Add support for showing start time in 24-hour format #78

merged 1 commit into from
Sep 9, 2023

Conversation

joncol
Copy link
Contributor

@joncol joncol commented Sep 5, 2023

Solves #55

main.go Outdated
@@ -178,6 +187,7 @@ var manCmd = &cobra.Command{
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")
Copy link
Owner

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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...

Copy link
Owner

Choose a reason for hiding this comment

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

yes plz

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I'll squash the fixup commits before potential merge.

Copy link
Owner

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

minor comment, other than that LGTM 🙏🏻

main.go Outdated
Comment on lines 94 to 95
case "kitchen":
startTimeFormat = time.Kitchen
Copy link
Owner

Choose a reason for hiding this comment

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

can be removed, handled by default

@caarlos0 caarlos0 merged commit 1661ac2 into caarlos0:main Sep 9, 2023
@caarlos0
Copy link
Owner

caarlos0 commented Sep 9, 2023

Thank you!

@joncol joncol deleted the add-twentyfour-hour-start-time-format branch September 11, 2023 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants