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

Allow 24:00 as military time #2241

Open
BUONJG opened this issue Sep 14, 2023 · 2 comments
Open

Allow 24:00 as military time #2241

BUONJG opened this issue Sep 14, 2023 · 2 comments
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.

Comments

@BUONJG
Copy link

BUONJG commented Sep 14, 2023

Military time validator allow string from 00:00 to 23:59.
For my project usage it could be convenient to allow 24:00

Does it make sense for you?

It could be allowed via an option.

A fast research on the web seems to consider 24:00 as a valid value: https://militarytimechart.com/

Regards,

Jean-Guy BUON

@BUONJG BUONJG added flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features. labels Sep 14, 2023
@braaar
Copy link
Member

braaar commented Mar 19, 2024

I suppose you're right about the usage of 24:00 in military contexts.

I suppose an option is the only way to let people also use this validator for plain old HH:MM validation in a non-military context where 24:00 would be invalid. The question is: Should this validator be used that way? "Military time" has a very specific connotation in to me. It feels odd to use it for plain old HH:MM validation in my country, since it's not military time here, it's just how you write the time of day normally.

If it can be demonstrated that some users of the term "Military time" consider 24:00 invalid, this should be added as an option. Otherwise, I'm happy to just add support for 24:00 and tell people who don't want 24:00 to implement a separate validator for that if they want it, such as IsTimeOfDay

@BUONJG
Copy link
Author

BUONJG commented Mar 19, 2024

Thank you for your reply braaar.

I'm not a specialist of military time concept. I just know in my usecase I needed to allow 24:00.

We have an interface to define working hours per day as below:
image

We need to allow 24:00 in order to complete the day.

We created our own MilitaryTime validator witch allows 24:00 in addition of other allowed strings.
If you decide to adapt the validator it will allow us to remove this fix, always a good thing! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.
Development

No branches or pull requests

2 participants