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

Multiple available formats for timestamp flag #1958

Closed
3 tasks done
horockey opened this issue Aug 6, 2024 · 0 comments · Fixed by #1959
Closed
3 tasks done

Multiple available formats for timestamp flag #1958

horockey opened this issue Aug 6, 2024 · 0 comments · Fixed by #1959
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this

Comments

@horockey
Copy link
Contributor

horockey commented Aug 6, 2024

Checklist

  • Are you running the latest v3 release? The list of releases is here.
  • Did you check the manual for your release? The v3 manual is here.
  • Did you perform a search about this feature? Here's the GitHub guide about searching.

Problem

Hi!
Using lib I found inconvenient moment: only possible time format, but often it is more convenient and intuitive to set time in shortened formats (ex. 1:06PM instead of '2024-08-06 13:06:00Z').

In v3 it can be solved by writing flag using value with custom Set() AND this value can be gotten via Command.Timestamp(), unlike in v2, where context.Timestamp() casts value to concrete type.

But I suppose it may be a common problem and it is better to feat this feature into lib instead of solving it locally with custom realizations.

Solution suggestion

I suggest to add multiple available time formats for flag and try to parse given value by each of them until parse is successful.
See details in PR

@horockey horockey added area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this labels Aug 6, 2024
@horockey horockey changed the title Multiple avaliable formats for timestamp flag Multiple available formats for timestamp flag Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant