Skip to content

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

Merged
caarlos0 merged 1 commit intocaarlos0:mainfrom
joncol:add-twentyfour-hour-start-time-format
Sep 9, 2023
Merged

Add support for showing start time in 24-hour format#78
caarlos0 merged 1 commit intocaarlos0:mainfrom
joncol:add-twentyfour-hour-start-time-format

Conversation

@joncol
Copy link
Copy Markdown
Contributor

@joncol joncol commented Sep 5, 2023

Solves #55

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")
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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