# Date range control

If you are working with a data source that requires a date range when fetching
data, you can take advantage of the \[Data Studio date range features\].

To enable the date range control feature for your Community Connector, set
`dateRangeRequired` to `true` in your
[`getConfig`](https://developers.google.com/data-studio/connector/reference.md.txt#getconfig) response. Then,
Data Studio will include a start and end date with every
[`getData`](https://developers.google.com/data-studio/connector/reference.md.txt#getdata) request made to your
connector.

## `getData` behavior when `dateRangeRequired` is `true`

When `dateRangeRequired` is set to `true` in your `getConfig` response, each
[`getData`](https://developers.google.com/data-studio/connector/reference.md.txt#getdata) request will contain a
`dateRange` object with `startDate` and `endDate` parameters. The date
parameters will be in `YYYY-MM-DD` format. You can use these values in data
fetch requests to third-party services.

- By default, the date range provided will be the last 28 days, excluding today.
- If a user applies a date range filter for a report then the date range provided will reflect the user selection.
- When Data Studio is attempting to detect [semantic types](https://developers.google.com/data-studio/connector/semantics.md.txt), [`sampleExtraction`](https://developers.google.com/data-studio/connector/reference.md.txt#request_3) is set to `true` in `getData` requests. For these requests, the date provided for the start and the end date is two days earlier than today.