class-validator icon indicating copy to clipboard operation
class-validator copied to clipboard

feat: add IsDuration decorator

Open os-moussao opened this issue 8 months ago • 1 comments

Description

Add IsDuration decorator for checking duration strings (e.g. "30 Days", "1 week", "10s"). It is designed to match the format of ms, since it's widely used among libraries for duration conversion.

Checklist

  • [x] the pull request title describes what this PR does (not a vague title like Update index.md)
  • [x] the pull request targets the default branch of the repository (develop)
  • [x] the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • [x] tests are added for the changes I made (if any source code was modified)
  • [x] documentation added or updated
  • [x] I have run the project locally and verified that there are no errors

Fixes

fixes #2613

os-moussao avatar Jun 03 '25 16:06 os-moussao

@braaar sorry for the tag, it has been almost 4 months waiting for this PR to be checked, would any of the maintainers take a quick look 🙏🙏

os-moussao avatar Oct 25 '25 11:10 os-moussao