The DateFilter controller makes it possible to create a date filter.

Example: date-filter.fn.tsx

interface DateFilter {
    state: DateFilterState;
    clear(): void;
    disable(): void;
    enable(): void;
    setRange(range: DateFilterRange): boolean;
    subscribe(listener: () => void): Unsubscribe;
}

Hierarchy (View Summary)

Methods

  • Clears the current filter.

    Returns void

  • Disables the filter. I.e., prevents it from filtering results.

    Returns void

  • Enables the filter. I.e., undoes the effects of disable.

    Returns void

  • Updates the selected range.

    You can use the buildDateRange utility method in order to format the range values correctly.

    Parameters

    Returns boolean

    Whether the range is valid.

  • Adds a callback that's invoked on state change.

    Parameters

    • listener: () => void

      A callback that's invoked on state change.

    Returns Unsubscribe

    A function to remove the listener.

Properties

The state of the DateFilter controller.