Meteor fullcalendar+momentjs在使用会话时引发异常

Meteor fullcalendar+momentjs在使用会话时引发异常,meteor,fullcalendar,Meteor,Fullcalendar,我正在使用fullcalendar插件和meteor 大约在meteor转到0.8.1和fullcalendar转到2.1.0的时候,我在将fullcalendar calEvent对象放入meteor会话时开始收到一个错误。我在日历事件上做一个简单的点击,并将当前对象存储在meteor会话对象中 Session.set('Calendar_currentSelected', calEvent); calEvent对象包含一些简单字段,但主要错误似乎与开始日期和结束日期对象有关,因为它们是嵌入

我正在使用fullcalendar插件和meteor

大约在meteor转到0.8.1和fullcalendar转到2.1.0的时候,我在将fullcalendar calEvent对象放入meteor会话时开始收到一个错误。我在日历事件上做一个简单的点击,并将当前对象存储在meteor会话对象中

Session.set('Calendar_currentSelected', calEvent);
calEvent对象包含一些简单字段,但主要错误似乎与开始日期和结束日期对象有关,因为它们是嵌入对象:

Uncaught RangeError: Maximum call stack size exceeded in moment JS

有什么想法吗?

看起来您的calEvent对象不可序列化。会话例程总是试图在幕后使用JSON.stringify将对象转换为字符串。我可以在这里看到两种解决方案。您可以通过将包含的每个时刻对象转换成日期来确保您的CalEvter事件是可序列化的,或者您可以考虑使用ReActuvEAR外观,它允许您存储任何类型的对象并保持反应性,尽管使用该会话有点困难。

以及moment JS如何参与该过程?calEvent对象中有几个moment对象,一个用于开始日期,另一个用于结束日期