Productivity Analytics - Incorrect date range calculation

Summary

There appears to be a bug with the date range calculation for productivity analytics. Navigating to a link that already includes the merged_after and merged_before url parameters incorrectly calculates the date range to include an extra day.

Steps to reproduce

  1. Navigate to productivity analytics
  2. Select a date range, the url parameters should update to include the merged_after/merged_before parameters
  3. Note down the # of days selected
  4. Reload the page
  5. Observe the # of days selected

Example Project

What is the current bug behavior?

  • The selected days is incremented by 1
  • Most likely due to incorrect timezone calculations

What is the expected correct behavior?

  • The date range should be the same

Relevant logs and/or screenshots

productivity-analytics-date-range

Possible fixes

  • Possibly related to the data-* attribute data that's passed into the page
  • This might be fixed by moving to the shared filter bar