matchDateFilterToDateFilterOptionWithPreference()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Tries to match a preset or a form with the provided value. Prioritizes the provided option if possible.
export declare function matchDateFilterToDateFilterOptionWithPreference(dateFilter: IDashboardDateFilter | undefined, availableOptions: IDateFilterOptionsByType, preferredOptionId: string | undefined): IDateFilterOptionInfo;
Parameters
Parameter | Type | Description |
|---|---|---|
dateFilter | IDashboardDateFilter | undefined | value to match against |
availableOptions | date options available | |
preferredOptionId | string | undefined | id of the option that should be matched first if possible |
Returns
Remarks
This is to handle cases when user picked a form and filled values that match an existing preset. In those cases we want to show the form as picked even though a preset would otherwise be preferred.