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:

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: 

Stack Trace:
Error is happening in sf js, this stack trace of the error "Object.toUserTime()@

Appears to be an error in Moment.Js library being used
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.