joi-duration-extensions
Joi extensions for durations.
Lead Maintainer: Tom Yam
Durations are parsed with zeit/ms. All issues regarding parsing should be opened there.
Usage
Usage is a two steps process. First, a schema is constructed using the provided types and constraints:
const BaseJoi = ;const Extension = ;const Joi = BaseJoi; Joivalue // 31557600000Joivalue // 172800000Joivalue // 86400000Joivalue // 36000000Joivalue // 9000000Joivalue // 100 // If value cannot be parsed it's an errorJoierrormessage // "value" must be a valid ms duration'
API
See the API Reference.
Based on hapijs/joi-date-extensions