Options
Menu

Dynamic module "customValidators/DateCompareValidator"

ngdoc

object

name

DateCompareValidator

requires

moment

requires

underscore

description

DateCompareValidator enables to compare date to another date (CompareTo).

property

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

property

IgnoreDate It forces to ignore time part of date by date compare.

example

             //create validator
             var validator = new dateCompareValidator();
             validator.CompareTo = new Date(2000,2,2);
             validator.CompareOperator = Validation.CompareOperator.LessThanEqual;
            
            
             //less more than month -> return true
             var result = validator.isAcceptable(new Date(2000,1,1));
             //equal up to days -> return true
             var result = validator.isAcceptable(new Date(2000,2,2));
            

Index

Properties

CompareOperator

CompareOperator: Validation.CompareOperator

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

CompareTo

CompareTo: Date

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

IgnoreTime

IgnoreTime: boolean

It forces to ignore time part of date by date compare.

tagName

tagName: string

Methods

isAcceptable

  • isAcceptable(s: any): boolean
  • Parameters

    • s: any

    Returns boolean

Generated using TypeDoc