Sets the options for the date range filter validators. Default { fromDateIndex: 0, toDateIndex: 1 }.
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
Generates two functions for validating Date Ranges. Inputs for this function expects the date filters to be defined under a single key in FilterValues.