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 and Date range input incorrect end time #3449

Closed
ppiscuc opened this issue Mar 27, 2019 · 4 comments · Fixed by #3557
Closed

Date range picker and Date range input incorrect end time #3449

ppiscuc opened this issue Mar 27, 2019 · 4 comments · Fixed by #3557

Comments

@ppiscuc
Copy link

ppiscuc commented Mar 27, 2019

Environment

node v10.15.3
yarn 1.12.3
@blueprintjs/core 3.14.1
@blueprintjs/datetime 3.7.1
Chrome 73.0.3683.86
Ubuntu 18.10 x64

Steps to reproduce

  1. Go to https://blueprintjs.com/docs/#datetime/daterangepicker
  2. select allow single day range and time precision = minutes
  3. click Yesterday

It can be reproduces by selecting any time filter on the left of the date range picker.
It can be reproduces also with the daterangeinput

Actual behavior

My computer reports that today is 27.03.2019.
The output is:
Tuesday, March 26, 2019 12:00 AM -> Tuesday, March 26, 2019 12:00 AM

Expected behavior

Tuesday, March 26, 2019 12:00 AM -> Wednesday, March 27, 2019 12:00 AM

Possible solution

Consider today: 27.03.2019 00:00 -> now or 27.03.2019 00:00 -> 28.03.2019 00:00
yesterday: 26.03.2019 00:00 -> 27.03.2019 00:00
past week: 21.03.2019 00:00 -> 28.03.2019 00:00

@Neskews
Copy link

Neskews commented Mar 28, 2019

Since it is a date RANGE picker, I understand why you expect it to actual select a range. On the other hand, yesterday isn't a range. So I guess it's expected behavior.

@adidahiya
Copy link
Contributor

Single day ranges are allowed in the range picker. That's why we have the prop.

I can't repro this @ppiscuc. Which time zone are you in?

Today:

image

Yesterday:

image

@ppiscuc
Copy link
Author

ppiscuc commented Mar 30, 2019

@adidahiya in your first example, the difference between end time and start time = 0
in the second example, the difference between endtime and start time = 0

I fail to understand how today is valid to define it as a 0 range, and yesterday = a 0 range

The same for a week with minutes selected: the difference between endtime and starttime is 6 days (for example: Sunday, March 24, 2019 12:00 AM -> Saturday, March 30, 2019 12:00 AM ), not 7 days.

The issue is not the single date range picker, although there the issue is the most visible. The issue is that the range picker with minutes makes every period with 24h less (today range: 0 minutes, yesterday:0 minutes, a week ago: 6 days etc.)

@adidahiya
Copy link
Contributor

Ah, sorry, you're right, I see the problem. I wasn't paying close enough attention to the minutes. Yes, I think this is a bug, the range should be 24h, not 0h

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants