Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 470 Bytes

is-valid-range.md

File metadata and controls

15 lines (12 loc) · 470 Bytes

isValidRange

This returns a boolean indicating whether the DayjsRange object contains a valid date or not.

Example

import dayjsRange from 'dayjs-range-extend';

const dateRangeFirst = dayjsRange('2022-01-01', '2022-01-05');
const dateRangeSecond = dayjsRange('2022-01-04');
const dateRangeThird = dayjsRange('', '2022-01-10');

dateRangeFirst.isValidRange() // => true
dateRangeSecond.isValidRange() // => true
dateRangeThird.isValidRange() // => false