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

# addDateFilter()

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

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates the AddDateFilter command. Dispatching this command will result in the addition of another date filter with defined dimension to the dashboard's filter bar, at desired position, or error in case of invalid update (e.g. wrong or duplicated date dimension/data set)

The filter will be set for the date dimension provided by reference. When created, the filter will be no-op - all time filter.

**Signature:**

```typescript
export declare function addDateFilter(dateDataset: ObjRef, index: number, correlationId?: string): IAddDateFilter;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dateDataset | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | specify date dimension/data set which will be used for filtering of all widgets |
| index | number | specify index among the filters at which the new filter should be placed. The index starts at zero and there is convenience that index of -1 would add the filter at the end. |
| correlationId | string | _(Optional)_ specify correlation id to use for this command. this will be included in all |

**Returns:**

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