-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Describe the problem you are trying to fix (provide as much context as possible)
If a payload should contain a duration, it may be desirable to require a ISO duration string rather than a number which assumes the caller knows whether it should be in minutes, hours, etc.
ISO 8601 standard for Durations as defined here could be validatable with joi. moment.js has support for duration strings, so going from a validated duration string to a moment.Duration object to use in whatever way would be seamless.
Which API (or modification of the current API) do you suggest to solve that problem ?
Maybe add a .duration() to DateSchema, or add a DurationSchema, not sure
Are you ready to work on a pull request if your suggestion is accepted ?
Possibly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement