How to use the availity-reactstrap-validation.AvValidator.dateRange function in availity-reactstrap-validation

To help you get started, we’ve selected a few availity-reactstrap-validation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Availity / availity-reactstrap-validation / __test__ / AvValidator.dateRange.spec.js View on Github external
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat'
import {AvValidator} from 'availity-reactstrap-validation';
import {inputTypeOverride} from 'availity-reactstrap-validation/AvValidator/utils';

dayjs.extend(customParseFormat);

const fn = AvValidator.dateRange;
const input = {props: {type: 'text'}};
const context = {};
let date0;
let date1;
let date2;

describe('Date Range Validation', () => {
  beforeEach(() => {
    date0 = dayjs(new Date());
    date1 = dayjs(new Date());
    date2 = dayjs(new Date());
  });

  it('should not require a value', () => {
    expect(fn('', context, undefined, input)).to.be.true;
  });