Build information:

Issue Description:
-Blackout schedules are not showing up on the Conflict Calendar in month view.
-Default view is day view in which the blackout schedule shows up as expected.
-Seems to be issue with Calendar API

Steps to Reproduce

Define a blackout schedule that contains a schedule entry that spans from one month to another
Ensure the condition of this blackout schedule is simple, applies to cmdb_ci
Open the Conflict Calendar for any Change Request (as the condition should apply)
Navigate to the month where this schedule should start
Try to navigate to the month where the span should end

Expected: spans are present as expected

Actual: spans are missing from the calendar


The workaround requires a utility function to be overwritten, by introducing this change a UI Script will have to be modified that will mean future updates will be skipped when upgrading. Please ensure future skipped updates are applied.

The "change_calendar.vcal.snChangeCabCalendar" UI Script (link follows) is where the workaround needs to be applied.

Within the UI Script, locate a function named “buildPhantomEventMap” it makes use of the “getAllDaysInDateRange” API. Above the "buildPhantomEventMap" function, define another exactly as the following:

function getAllDaysInDateRange(startDate, endDate) {
	var currentDate = moment(startDate);
	var startOfCurrentDate = currentDate.clone().startOf("day");
	var end = moment(endDate);
	var res = [];
	do {
		currentDate.add(1, "day");
		startOfCurrentDate.add(1, "day");
	} while (startOfCurrentDate.isBefore(end));
	return res;

Now, update “calendarUtils.getAllDaysInDateRange” (located in the “buildPhantomEventMap” function) to just “getAllDaysInDateRange”, which will make use of the newly defined function.

Related Problem: PRB1293113

Seen In

There is no data to report.

Fixed In

London Patch 5

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:41:42