connect icon indicating copy to clipboard operation
connect copied to clipboard

improve TimeFilter for custom date

Open BBBmau opened this issue 1 year ago • 0 comments

Fixes #462 - This was due to input type of "date" being a timezone-less date and using the local time instead of GMT time. This is discussed here

tl;dr: from the calendar we pick a date (27th July 2012 00:00:00 BST (GMT+1)) which gets converted to (23:00:00 on 26th July 2012) when getting through valueAsDate

The fix is to use UTC to prevent this confusion.

Also set minDate to be startDate for end date selection, this prevents users to be able to choose a date that is before the start date. Before there was no catch for this.

Before fix: image

After fix: image

BBBmau avatar Apr 28 '24 21:04 BBBmau