Notifications

39 views

Description

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

Workaround

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.
/sys_ui_script.do?sys_id=279071560b2332005775aabcb4673a50

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 {
		res.push(currentDate.clone().toDate());
		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.

Intended Fix Version

Madrid

Fixed In

London Patch 5

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-03-08 09:12:37
Published:2019-03-08