Checks if the given value is a valid Dayjs duration not longer than maximum.
maximum
The minimum can be given as either:
"PT1H"
{ hour: 1, minute: 30 }
[1, 'hour]
// Ensure the value is a duration at most 1 hour long@MaxDuration([1, 'hour'], { inclusive: true })value: Duration Copy
// Ensure the value is a duration at most 1 hour long@MaxDuration([1, 'hour'], { inclusive: true })value: Duration
The maximum allowed value.
Optional
Accepts the following options (in addition to generic class-validator options):
inclusive: boolean = false
Checks if the given value is a valid Dayjs duration not longer than
maximum
.The minimum can be given as either:
"PT1H"
{ hour: 1, minute: 30 }
[1, 'hour]
Example