Namespace: op

op

Functions to compare two date values.
Source:

Methods

(static) opEqualTo(date1, date2) → {boolean}

Operates a comparison between two dates where the one should be equal to the other.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opEqualTo( '01/01/2021', '02/01/2021' ); // returns false
opEqualTo( '02/01/2021', '02/01/2021' ); // returns true
opEqualTo( '03/01/2021', '02/01/2021' ); // returns false
opEqualTo(); // returns null

- - -

(static) opGreaterThan(date1, date2) → {boolean}

Operates a comparison between two dates where the first should be greater than the second.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opGreaterThan( '01/01/2021', '02/01/2021' ); // returns false
opGreaterThan( '02/01/2021', '02/01/2021' ); // returns false
opGreaterThan( '03/01/2021', '02/01/2021' ); // returns true
opGreaterThan(); // returns null

- - -

(static) opGreaterThanEqualTo(date1, date2) → {boolean}

Operates a comparison between two dates where the first should be greater than or equal to the second.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opGreaterThanEqualTo( '01/01/2021', '02/01/2021' ); // returns false
opGreaterThanEqualTo( '02/01/2021', '02/01/2021' ); // returns true
opGreaterThanEqualTo( '03/01/2021', '02/01/2021' ); // returns true
opGreaterThanEqualTo(); // returns null

- - -

(static) opLessThan(date1, date2) → {boolean}

Operates a comparison between two dates where the first should be less than to the second.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opLessThan( '01/01/2021', '02/01/2021' ); // returns true
opLessThan( '02/01/2021', '02/01/2021' ); // returns false
opLessThan( '03/01/2021', '02/01/2021' ); // returns false
opLessThan(); // returns null

- - -

(static) opLessThanEqualTo(date1, date2) → {boolean}

Operates a comparison between two dates where the first should be less than or equal to the second.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opLessThanEqualTo( '01/01/2021', '02/01/2021' ); // returns true
opLessThanEqualTo( '02/01/2021', '02/01/2021' ); // returns true
opLessThanEqualTo( '03/01/2021', '02/01/2021' ); // returns false
opLessThanEqualTo(); // returns null

- - -

(static) opNotEqualTo(date1, date2) → {boolean}

Operates a comparison between two dates where the one should not be equal to the other.
Parameters:
Name Type Description
date1 Object | Array.<Object> | string | Date The first date
date2 Object | Array.<Object> | string | Date The second date
Source:
Returns:
True or false or null on invalid params
Type
boolean
Example
opNotEqualTo( '01/01/2021', '02/01/2021' ); // returns true
opNotEqualTo( '02/01/2021', '02/01/2021' ); // returns false
opNotEqualTo( '03/01/2021', '02/01/2021' ); // returns true
opNotEqualTo(); // returns null 

- - -