You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 amoment.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()
toDateSchema
, or add aDurationSchema
, not sureAre you ready to work on a pull request if your suggestion is accepted ?
Possibly
The text was updated successfully, but these errors were encountered: