function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Thomas DennisThomas Dennis 

Moment JS Internal SF Library Error Calling Event Object Creation Modal

Trying to add a button that creates records utilizing this method:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_createRecord.htm

It appears salesforce uses the Moment JS library in regards to the event object and it is causing an error on modal creation when the button is clicked. 

The error throws in libraries and name of it: force:calendarLibrary.js. If you open this file in developer console in chrome, then you can click on { } button to see it in formatted way, then you need line 197. Small video demonstration:
https://www.screencast.com/t/gFJ9K0Ah 

Stack Trace:
Error is happening in sf js, this stack trace of the error "Object.toUserTime()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:9:553
Object.writeStartDateTimeToActivityDate()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:55:262
Object.init()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:61:407
onInit()@https://ffcommdemo-developer-edition.na30.force.com/components/sfa/eventDateTime.js:1:508" 

Appears to be an error in Moment.Js library being used
https://github.com/moment/moment-timezone/issues/468
ForeFront CorpForeFront Corp
Adding the moment timezone library will resolve this issue. The object references it in the out of the box calendar page which is associated with the event object.