我试图在放入js fullcalendar时设置事件的结束日期。
结束日期是2小时太长,我想这是一个时区问题,因为我有CET时间,它是UCT + 2小时。我怎么能纠正这个?
我有以下代码:
eventReceive: function (event){
event.allDay = false;
event.end = event.start.clone().add(2, 'hours').toDate();
console.log(event.start);
console.log(event.end);
$calendar.fullCalendar('updateEvent', event);
console.log(event.end);
}
它在控制台中输出以下内容:
2:875 m {_isAMomentObject: true, _i: Array[7], _isUTC: true, _offset: 0, _pf: Object…}_ambigZone: true_d: Wed Jul 08 2015 10:00:00 GMT+0200 (Central Europe Daylight Time)_fullCalendar: true_i: Array[7]_isAMomentObject: true_isUTC: true_isValid: true_locale: e_offset: 0_pf: Object__proto__: m
2:876 Wed Jul 08 2015 12:00:00 GMT+0200 (Central Europe Daylight Time)
2:878 m {_isAMomentObject: true, _i: Array[7], _isUTC: true, _offset: 0, _pf: Object…}_ambigZone: true_d: Wed Jul 08 2015 14:00:00 GMT+0200 (Central Europe Daylight Time)_fullCalendar: true_i: Array[7]_isAMomentObject: true_isUTC: true_isValid: true_locale: e_offset: 0_pf: Object__proto__: m