How to create Calendar using Scheduled Page

peter_repan
Tera Guru

Hi all,

I'm trying to create Calendar from Scheduled Page as described in documentation.

I'm using link:

show_schedule.do?sysparm_type=release_calendar&sysparm_include_view=monthly,weekly,daily,oldtimeline

in module to show calendar.

The calendar should show data from Release table. I would like to display all Planned start dates and I'm using the script like on the picture below:

find_real_file.png

However, it does not work as expected. All the entries in calendar are displaying in one day (today).

Don't know what I'm doing wrong and I'm missing documentation about "Server AJAX processor" script.

Does anyone have some hints how to display single dates in Calendar using Scheduled Page?

I understand if I use:

var item = schedulePage.addItem(gr, start, end, '', '#318047');

it should display period. I'd like to also display single dates.

I though:

var item = schedulePage.addItem(gr, start, '', '', '#318047');

will do the trick, but seems it's not working as expected.

1 REPLY 1

jeremyaubin
Kilo Contributor

I wanted something similar with our Loaner Pool Service Requests, what i did to trick the end date was to just add "1" to the Start Date.  That makes the records show up on the calendar with just the start or due date in my case since i'm pulling "due date" which is what we used for when a loaner item should be returned.

gr = new GlideRecord('sc_req_item');
var start = schedulePage.getParameter('start');
var end = schedulePage.getParameter('end');
//gr.addQuery('active', 'true');  //uncomment to only show active ones

gr.addEncodedQuery("due_dateBETWEENjavascript:'"+start+"'@javascript:'"+end+"'^ORdue_dateBETWEENjavascript:'"+start+"'@javascript:'"+end+"'");
gr.query();
while (gr.next()) {
var start = gr.due_date.getDisplayValue();
var end = gr.due_date.getDisplayValue() + 1; //add 1 to the date to make the items show properly
//var item = schedulePage.addItem(gr, start, end, '', '#318047');
var item = schedulePage.addItem(gr, start, end, '', '#318047');
if (item)
item.setDescription(gr.short_description.toString());
}