# New Date Range Picker for custom date ranges

We've added a new Date Range Picker to our Analytics dashboard to make it easier to select custom date ranges for your reports.

- Published: May 22, 2024
- Authors: [Steven Tey](https://dub.co/authors/steven)
- Source: https://dub.co/changelog/date-range-picker

We've added a new Date Range Picker to our Analytics dashboard to make it easier to select custom date ranges for your reports.

You can select from a few preset date ranges like "Last 30 days", "Last 3 months", "Year to Date", or choose a custom date range. Here's a [live demo](https://d.to/stats/try) for you to try it out.

This is also supported in our [API](https://dub.co/docs/api-reference/endpoint/retrieve-analytics) via the `start` and `end` query parameters. Here's an example:

```typescript title="get-analytics.ts"
import { Dub } from "dub";

const dub = new Dub();

const data = await dub.analytics.retrieve({
  groupBy: "timeseries",
  start: "5 days ago", // natural language is supported
  end: new Date(Date.now()),
});

console.log(data); // [{ start: "2024-05-17", clicks: 69 }, { start: "2024-05-18", clicks: 42 }, ...]
```

Check out the [docs](https://dub.co/docs/sdks/typescript/analytics/retrieve) to learn more.

See [the full changelog](https://dub.co/changelog.md).
