-
Notifications
You must be signed in to change notification settings - Fork 841
Closed
Labels
status: needs triageIssues which needs to be reproduced to be verified report.Issues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.Issues describing a broken feature.
Description
Description
MaxDate determines whether the value is a date that falls on or before the given date.
But in a comment, it says "After"
Minimal code-snippet showcasing the problem
/**
* Checks if the value is a date that's after the specified date. (it should be before not after)
*/
export function MaxDate(date: Date | (() => Date), validationOptions?: ValidationOptions): PropertyDecorator {
return ValidateBy(
{
name: MAX_DATE,
constraints: [date],
validator: {
validate: (value, args): boolean => maxDate(value, args?.constraints[0]),
defaultMessage: buildMessage(
eachPrefix => 'maximal allowed date for ' + eachPrefix + '$property is $constraint1',
validationOptions
),
},
},
validationOptions
);
}Expected behavior
/**
- Checks if the value is a date that's before the specified date.
*/
Actual behavior
/**
- Checks if the value is a date that's after the specified date.
*/
Metadata
Metadata
Assignees
Labels
status: needs triageIssues which needs to be reproduced to be verified report.Issues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.Issues describing a broken feature.