// Uncomment this for development only. The render handler should be cached. No dynamic data from url parameters etc.
//request.element.isStatic = 0;
// START - Cache until 2:30:00 AM each day
validTillTime = "02:30:00"; // time cacheTill as 24-hr clock value
currentDT = Now();
todayD = DateFormat( currentDT , "yyyy-mm-dd" );
nowDT = todayD & " " & TimeFormat( currentDT , "HH:mm:ss" );
validTillTodayDT = todayD & " " & validTillTime;
tomorrowD = DateFormat( DateAdd( 'd', 1, todayD ), "yyyy-mm-dd" );
validTillTomorrowDT = tomorrowD & " " & validTillTime;
validTodayCompare = DateCompare(nowDT,validTillTodayDT);
validTomorrowCompare = DateCompare(nowDT,validTillTomorrowDT);
if ( validTodayCompare LTE 0 AND validTomorrowCompare EQ -1 )
cacheValidUntilDT = validTillTodayDT;
else
cacheValidUntilDT = validTillTomorrowDT;
request.element.cacheValidUntil = cacheValidUntilDT;
// - Make sure that the element is static
request.element.isStatic = 1;
// END - Cache until 2:30 AM each day
// Get the Configuration and Page Map Values
appConfig = application.ptCalendar.getAppConfig();
cfDateDisplayMask = application.ptCalendar.getDisplayCFdateMask(); // "M/D/YYYY" - DATE FORMAT FOR DISPLAY
cfDateLongDisplayMask = application.ptCalendar.getDisplayCFdateLongMask(); // "dddd mmmm d, yyyy" - DATE FORMAT FOR DISPLAY
cfTimeDisplayMask = application.ptCalendar.getDisplayCFtimeMask(); // "h:mm tt" - TIME FORMAT FOR DISPLAY
// Set the Event Cache status from the configuration element
useEventsCache = application.ptCalendar.getEventCacheStatus();
// Get the items from the Display Properties Custom Element
items = attributes.elementInfo.elementData.propertyValues;
linkedCalendarPage = "";
linkedCalendarSubsite = "";
if ( ArrayLen(items) AND StructKeyExists(items[1],"values") )
{
if ( StructKeyExists(items[1].values,"linkedCalendarPage") )
linkedCalendarPage = application.ptCalendar.csData.parseCSURL(str=items[1].values.linkedCalendarPage);
if ( StructKeyExists(items[1].values,"linkedCalendarSubsite") )
linkedCalendarSubsite = items[1].values.linkedCalendarSubsite;
}
// - ptCalendar EventsCache designation (generally this will be true. May need to set to false for debugging)
// useEventsCache = false; // (true/false) - Use this as an override for the Global setting that is managed via the Configuration element
/* ** getRenderUpcomingEventsData *** */
// ptCalendar date and data processing returned as CF query object
// -- THIS MUST BE INCLUDED AT THE TOP OF THE ptCalendar Upcoming Events RenderHandler (after the getRenderEventData Settings)
eventData = application.ptCalendar.calRenderController.getRenderUpcomingEventsData(
displayPropsArray=items
,useEventsCache=useEventsCache
);
//application.ptCalendar.utils.doDump(items,"items",0);
//application.ptCalendar.utils.doDump(eventData,"eventData",1);
// Get the view link data structure
if ( application.ptCalendar.viewPageMode EQ "Single" ) {
if ( LEN(TRIM(linkedCalendarPage)) )
viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(pageURL=linkedCalendarPage);
else
viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct();
qParamDelimiter = "&";
}
else {
if ( LEN(TRIM(linkedCalendarSubsite)) )
viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(subsiteID=linkedCalendarSubsite);
else
viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct();
qParamDelimiter = "?";
}
detailLink = "";
dailyLink = "";
weeklyListLink = "";
weeklyGridLink = "";
monthlyListLink = "";
monthlyGridLink = "";
if( structKeyExists(viewLinkData, "detailPage") and len(trim(viewLinkData.detailPage)) )
detailLink = viewLinkData.detailPage;
if( structKeyExists(viewLinkData, "dailyPage") and len(trim(viewLinkData.dailyPage)) )
dailyLink = viewLinkData.dailyPage;
if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) )
weeklyListLink = viewLinkData.weeklyListPage;
if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) )
weeklyGridLink = viewLinkData.weeklyGridPage;
if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) )
monthlyListLink = viewLinkData.monthlyListPage;
if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) )
monthlyGridLink = viewLinkData.monthlyGridPage;
// Get the Default Calendar View Link
defaultCalendarViewLink = monthlyGridLink;
defaultViewPageVar = application.ptcalendar.calRenderViewDAO.getCalendarDefaultViewPageVar();
if( structKeyExists(viewLinkData,defaultViewPageVar) and LEN(TRIM(viewLinkData[defaultViewPageVar])) )
defaultCalendarViewLink = viewLinkData[defaultViewPageVar];
No upcoming events
[ALL DAY]
#timeFormat(eventData[itm].startTime, cfTimeDisplayMask)# - #timeFormat(eventData[itm].endTime, cfTimeDisplayMask)#
--->