matchDateFilterToDateFilterOptionWithPreference()
Home > @gooddata/sdk-ui-filters > matchDateFilterToDateFilterOptionWithPreference
matchDateFilterToDateFilterOptionWithPreference() function
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Tries to match a preset or a form with the provided value. Prioritizes the provided option if possible.
Signature:
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.