Skip to content

fix: Typo in MaxDate comment #2422

@namandeep-123

Description

@namandeep-123

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

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions