Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default all dates returned for a single day have the time set to
0
. But for today the timezone adjustments may end up on the day (before or after) at a specific hour. The current day isn't highlighted fortoday
later, as comparing doesn't match (https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/CoreHome/angularjs/date-picker/date-picker.directive.js#L312-L313) Setting the hour to0
always should fix thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This undoes the setHours() call above, maybe it can be removed? I added it to match the way periods were created server side, but I suppose client side it's just about selecting dates not determining when its needed to aggregate from...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it does not really "undo" the
setHours
. If the timezone offset is negativ the firstsetHours
might move the date to the day before and thesetHours(0)
will then set the hours to0
on that day. eg:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I understand now. Looks good, will merge!