- MaxDuration(
maximum:
| string
| Duration
| Partial<
{
days: number;
hours: number;
milliseconds: number;
minutes: number;
months: number;
seconds: number;
weeks: number;
years: number;
},
>
| [time: number, unit?: DurationUnitType],
options?: { inclusive?: boolean } & ValidationOptions,
): PropertyDecorator Parameters
- maximum:
| string
| Duration
| Partial<
{
days: number;
hours: number;
milliseconds: number;
minutes: number;
months: number;
seconds: number;
weeks: number;
years: number;
},
>
| [time: number, unit?: DurationUnitType] Optional
options: { inclusive?: boolean } & ValidationOptions
Returns PropertyDecorator
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