class-validator-extended - v4.2.0
    Preparing search index...

    Function PastDayjs

    • Checks if the given value is a valid Dayjs object in the past.

      Beware that the behaviour of this check depends on the current time and can thus be difficult to test.

      // Ensure the value is in the past.
      @PastDayjs()
      created: Dayjs

      Parameters

      • Optionaloptions: { allow_invalid?: boolean; granularity?: OpUnitType; inclusive?: boolean } & ValidationOptions

        Accepts the following options (in addition to generic class-validator options):

        • allow_invalid: boolean = false If true, allow the Dayjs object to be invalid (see isValid()).
        • inclusive: boolean = false If true, allow the current date as well.
        • granularity: string = 'milliseconds' Defines the granularity, e.g. "day" to ignore hours, minutes, seconds and milliseconds.

      Returns PropertyDecorator