All files / src/components/RangeDateField/utils isValidRange.ts

100% Statements 1/1
100% Branches 4/4
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8          39x    
import type {DateTime} from '@gravity-ui/date-utils';
 
import type {RangeValue} from '../../types';
 
export function isValidRange({start, end}: RangeValue<DateTime>): boolean {
    return start.isValid() && end.isValid() && (start.isSame(end) || start.isBefore(end));
}