> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# applyDateFilter()

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/commands/filters.ts

Creates the ChangeDateFilterSelection command.

**Signature:**

```typescript
export declare function applyDateFilter(filter: IDateFilter, correlationId?: string): ChangeDateFilterSelection;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filter | [IDateFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.idatefilter/index.md) | date filter to apply |
| correlationId | string | _(Optional)_ specify correlation id to use for this command. this will be included in all events that will be emitted during the command processing |

**Returns:**

[ChangeDateFilterSelection](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.changedatefilterselection/index.md)

## Remarks

Dispatching this command will result in change of dashboard's date filter, or error in case of invalid update (e.g. hidden date filter option by dateFilterConfig).

All parameters for [ChangeDateFilterSelection](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.changedatefilterselection/index.md) command is derived from the provided date filter.

See [ChangeDateFilterSelection](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.changedatefilterselection/index.md) for a more complete description of the different parameters
