Skip to content

Fix VSD column names not matching the date range

Alex Pennells requested to merge 439901-fix-wrong-month-name into master

What does this MR do and why?

Fixes a bug where on the first & last day of the month, the month name used as the column header did not match the date range used for the column. This was primarily caused by nMonthsBefore being used to transition to a month with shorter days (ex. March 31 > Feb 28 actually returns a day in early March, since Feb 31 does not exist).

I cleaned up the logic a bit and added a new test to avoid future regressions.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-03-22_at_11.17.18_AM Screenshot_2024-03-22_at_11.17.51_AM
Screenshot_2024-03-22_at_11.21.26_AM Screenshot_2024-03-22_at_11.21.47_AM

How to set up and validate locally

  1. Navigate to the VSD for any group:
http://gdk.test:3000/groups/flightjs/-/analytics/dashboards/value_streams_dashboard
  1. Mock the current date by returning a custom Date() here
export const generateValueStreamDashboardStartDate = () => {
  return new Date('2020-03-31');
};
  1. Validate that the table shows the correct column headers

Related to #439901 (closed) and #430043 (closed)

Edited by Alex Pennells

Merge request reports