Last night I migrated an application from one Centos server to another - in doing so the only thing which doesn't work is FullCalendar.
On the "old" server with exactly the same data and the same versions of jQuery, moment and Fullcalendar the calendar displays with no issues.
On the "new" server I get the error:
fullcalendar.min.js:963
Uncaught TypeError: Cannot read property 'stripTime' of undefined
at D (fullcalendar.min.js:963)
at b (fullcalendar.min.js:959)
at S (fullcalendar.min.js:955)
at E (fullcalendar.min.js:949)
at fullcalendar.min.js:816
at Object.success (fullcalendar.min.js:848)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at x (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)
D @ fullcalendar.min.js:963
b @ fullcalendar.min.js:959
S @ fullcalendar.min.js:955
E @ fullcalendar.min.js:949
(anonymous) @ fullcalendar.min.js:816
success @ fullcalendar.min.js:848
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
x @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
Line 963 is the content of this function:
function D(t) {
null == t.allDay && (t.allDay = !(t.start.hasTime() || t.end && t.end.hasTime())), t.allDay ? (t.start.stripTime(), t.end && t.end.stripTime()) : (t.start.hasTime() || (t.start = I.rezoneDate(t.start)), t.end && !t.end.hasTime() && (t.end = I.rezoneDate(t.end)))
}
I found an identical question at I use fullcalendar to make the event but there is no answer - also the only mention of striptime in the FullCalendar docs is at https://fullcalendar.io/docs/utilities/Moment/ where it talks about it being used for converting a timed moment to ambiguous but that doesn't mean a lot to me!
I cannot reproduce it which makes me think is there something in the server config causing the issue as that is the only different between old and new? I tried updating to the latest versions of both Moment and FullCalendar but neither made any difference
After a huge amount of trial and error I found the problem - one of my events had a start date of null and that was causing the issue.
The docs at https://fullcalendar.io/docs/utilities/Moment/ refer to striptime being used for Ambiguously-timed Moments which are "Under the hood, these moments are represented in UTC-mode with a time of 00:00:00"
I then went through all my events looking for any with a time of 00:00:00 - I actually found quite a few so I removed these and the issue still occured.
I then decided to look for entries where the date was 0 (or null in this case) and found one which, when I removed it, corrected the problem and the calendar now displays as it should.
Not sure why this was not an issue on the prior server but is on this issue but, if anyone else is in the same situation, check for null dates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With