Hi
I’m trying to implement Scheduler Builder (Pg. 74) of Sample Calendar app in my application. Few things different in my app are:
- My schedule calendar has Month navigation, no week.
- My Start and End dates are in DD-MON-YYYY format.
- I changed Date Selected (Calendar) event DA to set dates using below javascript to match my date format.
moment(this.data.newStartDate, “YYYYMMDDHHmmss”).format(“DD-MMM-YYYY”)
moment(this.data.newEndDate, “YYYYMMDDHHmmss”).format(“DD-MMM-YYYY”)
When date range is selected on the calendar, start and end dates are populated correctly. But in the console, I see below warning.
moment.min.js?v=19.2.0.00.18:291 Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: 07-Oct-2020, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at Function.createFromInputFallback (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:318:98)
at configFromString (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:2383:15)
at configFromInput (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:2609:13)
at prepareConfig (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:2592:13)
at createFromConfig (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:2559:44)
at createLocalOrUTC (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:2646:16)
at Function.createUTC [as utc] (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/lib/moment.min.js?v=19.2.0.00.18:86:16)
at i (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/js/fullcalendar.min.js?v=19.2.0.00.18:6:15257)
at h.parseZone (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/js/fullcalendar.min.js?v=19.2.0.00.18:6:15903)
at t.moment (https://oraapextran1.allscripts.com/i/libraries/jquery-fullcalendar/3.10.0/js/fullcalendar.min.js?v=19.2.0.00.18:10:31801)
My next issue is … I wrote another on change DA on start and end dates to highlight the schedule on the calendar using below Javascript expression.
var calWidget = apex.region(“absence_calendar”).widget();
var jsEvents = calWidget.fullCalendar( “clientEvents”, [“javascript-event-id”] );
var jsEvent;
console.log(“1.” + jsEvent);
console.log(“2.” + jsEvents.length);
if ( jsEvents.length != 0 ) {
jsEvent = jsEvents[0];
jsEvent.title = $v(“P2_TITLE”);
jsEvent.start = $v(“P2_START_DATE”);
jsEvent.end = $v(“P2_END_DATE”);
calWidget.fullCalendar( “updateEvent”, jsEvent );
} else {
calWidget.fullCalendar(
“renderEvent”,
{
id: “javascript-event-id”,
editable: false,
description: “this is a “client-only” event which is not stored in the database so far”,
title: $v(“P2_TITLE”),
start: $v(“P2_START_DATE”),
end: $v(“P2_END_DATE”),
className: “apex-cal-red”,
backgroundColor: “rgba(255,0,0,0.75)”,
overlap: true,
durationEdiable: false,
startEditable: false,
allDay: false
}
);
}
But the above code is not highlighting correct dates on the calendar. My expectation is
Start Date = 13-Oct-2020, End Date = 13-Oct-2020. Highlight only 13-Oct on calendar.
Start Date = 13-Oct-2020, End Date = 14-Oct-2020. Highlight 13-Oct and 14-Oct on calendar.
Please advise.
Thanks
Kishore
The MomentJS is a third-party library used to validate and manipulate date. Check the below link. There you will find the latest version and correct usage of commands:
https://momentjs.com/
Maybe you also need to update the moment JS library in your Oracle Apex application.