Business rules

Class FromToDateValidator

It validates passed date against constant from and to interval. You can check that passed date is greater than now and lower than one year for now.

Index

Properties

Methods

Properties

public From: Date

The datetime against the compare is done. If From is not set, then comparison is done against actual datetime.

public FromOperator: Validation.CompareOperator

Set the time of compare between passed date and From date.

public IgnoreTime: boolean

Ignore time part of date when compare dates.

public To: Date

The datetime against the compare is done. If From is not set, then comparison is done against actual datetime.

public ToOperator: Validation.CompareOperator

Set the time of compare between passed date and From date.

public tagName: string

Methods

public customMessage(config: any, args: any): string

It formats error message.

Parameters

  • config: any

    localization strings

  • args: any

    dynamic parameters

Returns

string

error message

public isAcceptable(s: any): boolean

Parameters

  • s: any

Returns

boolean

private isValid(now: any, then: any, compareOperator: Validation.CompareOperator): boolean

Parameters

  • now: any
  • then: any
  • compareOperator: Validation.CompareOperator

Returns

boolean