Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

feature: add @IsTime #2335

Closed
kimsey0 opened this issue Dec 7, 2023 · 3 comments
Closed

feature: add @IsTime #2335

kimsey0 opened this issue Dec 7, 2023 · 3 comments
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.

Comments

@kimsey0
Copy link

kimsey0 commented Dec 7, 2023

Description

It's currently not possible to validate time values like 12:34 using class-validator. These may come the time input HTML element.

Proposed solution

Add a new @IsTime validator which calls the isTime function from validator.js.

@kimsey0 kimsey0 added flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features. labels Dec 7, 2023
@kimsey0
Copy link
Author

kimsey0 commented Dec 7, 2023

I just now noticed there's @IsMilitaryTime. 🤦 (The believe the term "military time" is basically unknown outside the United States.)

I'd still suggest an @IsTime that just allows passing in the options for the validator.js isTime.

@braaar
Copy link
Member

braaar commented Dec 13, 2023

Perhaps it would be a good idea to start using isTime for @IsMilitaryTime and add @IsTime as an alias for it. PR welcome.

@braaar
Copy link
Member

braaar commented Jan 11, 2024

I'm moving this to the discussion tab, as we are trying to keep the issue count low. Please see this issue for an explanation.

@typestack typestack locked and limited conversation to collaborators Jan 11, 2024
@braaar braaar converted this issue into discussion #2364 Jan 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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