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

Date range picker picker broken in month of December #289

Closed
gscshoyru opened this issue Dec 1, 2016 · 4 comments
Closed

Date range picker picker broken in month of December #289

gscshoyru opened this issue Dec 1, 2016 · 4 comments

Comments

@gscshoyru
Copy link
Contributor

gscshoyru commented Dec 1, 2016

Bug report

  • Package version(s): 1.1.0
  • Browser and OS versions: Chrome (latest) on macOS

Steps to reproduce

  1. Have the date in your computer be December first. Or probably any day in December.
  2. Go to http://blueprintjs.com/docs/#components.datetime.daterangepicker.

Actual behavior

Shows December 2016 as the month on the left, and January 1996 as the month on the right.
Furthermore, you can go back a month with the arrow keys to get you something sensible, but it seems impossible to go past 2016 now, even picking a year from the dropdown doesn't seem to work.

Expected behavior

Shows January 2017, also lets you navigate past 2016.

@giladgray
Copy link
Contributor

this is actually expected behavior for the default DRP props: maxDate defaults to the end of the current year, which just happens to be this month. (why? because future dates are rarely useful in analytical apps--it's all data from the past.)

image

I'll agree that the "wrapping" behavior is awkward, but that happens inside react-day-picker, a third-party library that has served us very well thus far.

@gscshoyru
Copy link
Contributor Author

Didn't realize about the default max date behavior, that makes a certain amount of sense.

If we can't avoid the wrapping behavior because of the component we're using (which I get) then maybe just detect if we're opening a date at the end of our range, and go back a month instead of wrapping funny.

@llorca
Copy link
Contributor

llorca commented Dec 5, 2016

So, the bug here is actually that the date range picker should never display months that are out of range. If you look at the docs, January 1996 is showing although it's out of range. If you click on the left arrow near December, you'll see that there's no right arrow to go back to January 1996.

I think the fix is to simply have the last month of the available range be displayed on the right side of the range picker.

@VimLeSai
Copy link

VimLeSai commented Jan 3, 2020

in DateRangePicker in the first calendar, I'm not able to select December because it is like that December will be on another calendar only. so can do something so I can it in both calendar?

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

5 participants