• Generates two functions for validating Date Ranges. Inputs for this function expects the date filters to be defined under a single key in FilterValues.

    Type Parameters

    • T

    Parameters

    Returns [((key) => FilterValidatorFunction<T>), ((key) => FilterValidatorFunction<T>)]

    Example

    const [createFromValidator, createToValidator] = createDateRangeValidators<T>();
    const filters = FilterType<T>[] = {
    {
    label: 'Creation Period (From)',
    property: 'createdAt',
    type: FilterTypes.Date,
    onValidate: createFromValidator('createdAt'),
    },
    {
    label: 'Creation Period (To)',
    property: 'createdAt',
    type: FilterTypes.Date,
    onValidate: createToValidator('createdAt'),
    }
    }

Generated using TypeDoc