Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend default shortcuts of date range picker with MTD and YTD #5268

Open
severinlandolt opened this issue Apr 24, 2022 · 1 comment
Open

Comments

@severinlandolt
Copy link

Environment

Package version(s): Latest Blueprint version
Browser and OS versions: Latest Chrome version

Feature request

It would be great to extend the default shortcuts of the date range picker with the following options:

  • MTD: Month-to-date
  • YTD: Year-to-date

Examples

MTD: Today is April 24th, 2022. The month-to-date option would include the range from 01-04-2022 to 24-04-2022.
YTD: Today is April 24th, 2022. The year-to-date option would include the range from 01-01-2022 to 24-04-2022.

@adidahiya
Copy link
Contributor

This is very similar to a previous request: #4398

Adding MTD and YTD is currently possible, all you have to do is set the shortcuts prop on DateRangeInput or DateRangePicker.

However, it's not very easy to extend the set of default shortcuts, because we don't expose those in the public API:

function createDefaultShortcuts(

I'd be open to an API improvement which makes it easy to extend the default set instead of overriding the default shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants