import { PropertyValidator } from "../PropertyValidator" ; export class implements PropertyValidator < Date > export class IsBetweenValidator implements PropertyValidator < Date > { constructor ( private lowerDate , private upperDate , private lowerBoundary = "(" , private upperBoundary = ")" ) { } isValid ( input ) { if ( typeof input === "undefined" || input === null ) { return false ; } else if ( this . lowerBoundary === "[" && this . upperBoundary === "]" ) { return this . lowerDate . getTime ( ) <= input . getTime ( ) && input . getTime ( ) <= this . upperDate . getTime ( ) ; } else if ( this . lowerBoundary === "[" && this . upperBoundary === ")" ) { return this . lowerDate . getTime ( ) <= input . getTime ( ) && input . getTime ( ) < this . upperDate . getTime ( ) ; } else if ( this . lowerBoundary === "(" && this . upperBoundary === "]" ) { return this . lowerDate . getTime ( ) < input . getTime ( ) && input . getTime ( ) <= this . upperDate . getTime ( ) ; } else { return this . lowerDate . getTime ( ) < input . getTime ( ) && input . getTime ( ) < this . upperDate . getTime ( ) ; } } }