这太疯狂了,我不知道为什么!?
这是我的问题:
当我登录时calEvent.start
,我会在正确的时间得到正确的日期,但是!当我记录 obj 时calEvent
,我的开始日期不显示时间:(。
我愿意:
console.log('=======addNewEvent=========');
console.log('log of calEvent.start : ' + calEvent.start);
console.log('log of calEvent obj : ');
console.dir(calEvent);
console.log('========================');
这就是我得到的:
控制台.log(calEvent.start)
Fri Oct 25 2013 12:30:00 GMT-0400 (EDT)
控制台日志(calEvent)
Object
date: "2013-10-25"
date_end: "2013-10-25"
date_end_hour: "6:30 pm"
date_start_hour: "5:30 pm"
end: Fri Oct 25 2013 18:30:00 GMT-0400 (EDT)
end_date: "2013-10-25"
end_time: "18:30"
id: 109
location: "63"
presettype: null
repeat_type: "N"
start: Fri Oct 25 2013 00:00:00 GMT-0400 (EDT)
start_date: "2013-10-25"
start_time: "17:30"
time_zone: 4
title: "s"
type: "C"
typeClass: "class"
user_locations: null
zipcode: "10023"
如您所见,calEvent.start
显示正确的时间12:30:00但calEvent
将时间显示为00:00:00
知道为什么会这样吗?:(
注意:对不起我的英语*
========================= [设置calEvent.start的代码] ================ =========
eventSetEvent : function(calEvent, $event, $titleName, $typeName, $typeL) {
resetForm($dialogContent);
$dialogContent.dialog({
modal: true,
title: $titleName,
open: function() {
$(".j-start-time").timepicker('setTime', MAIN.calendar.from24To12(MAIN.calendar.getInfoFromDate().hours(calEvent.start) + ':'+ MAIN.calendar.getInfoFromDate().minutes(calEvent.start)) );
$(".j-end-time").timepicker('setTime', MAIN.calendar.from24To12(MAIN.calendar.getInfoFromDate().hours(calEvent.end) + ':'+ MAIN.calendar.getInfoFromDate().minutes(calEvent.end)) );
},
close: function() {
$dialogContent.dialog("destroy");
$('#calendar').weekCalendar("removeUnsavedEvents");
},
buttons: {
save : function() {
var x = new Date();
time_zone = x.getTimezoneOffset() / 60;
calEvent.id = id;
id++;
MAIN.calendar.validation();
if( $typeL == 'C') {
calEvent.typeClass = 'class';
}
if( $typeL == 'P') {
calEvent.typeClass = 'private';
}
if( $typeL == 'O') {
calEvent.typeClass = 'available';
}
if( $('.error-field').doesExist() ) {
$('.j-err-msg').fadeIn();
} else {
$('.j-err-msg').fadeOut();
calEvent.date = MAIN.calendar.getInfoFromDate().year(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().month(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().day(calEvent.start);
calEvent.date_end = $('.j-date').val() != '' ? $('.j-date').val() : MAIN.calendar.getInfoFromDate().year(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().month(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().day(calEvent.start);
calEvent.date_end_hour = $('.j-end-time').val().toLowerCase();
calEvent.date_start_hour = $('.j-start-time').val().toLowerCase();
calEvent.end_date = $('.j-date').val() != '' ? $('.j-date').val() : MAIN.calendar.getInfoFromDate().year(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().month(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().day(calEvent.start);
calEvent.end_time = MAIN.calendar.getInfoFromDate().hours(calEvent.end) + ':' + MAIN.calendar.getInfoFromDate().minutes(calEvent.end);
calEvent.presettype = null;
calEvent.repeat_type = $('.j-radio-repeat:checked').val();
calEvent.start_date = MAIN.calendar.getInfoFromDate().year(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().month(calEvent.start) + '-' + MAIN.calendar.getInfoFromDate().day(calEvent.start);
calEvent.start_time = MAIN.calendar.getInfoFromDate().hours(calEvent.start) + ':' + MAIN.calendar.getInfoFromDate().minutes(calEvent.start);
calEvent.time_zone = time_zone;
calEvent.title = $('.j-title').val() ;
calEvent.type = $typeL;
calEvent.user_locations = null;
calEvent.zipcode = $('.j-zipcode').val();
MAIN.calendar.addNewEvent(calEvent);
$calendar.weekCalendar("removeUnsavedEvents");
$calendar.weekCalendar("updateEvent", calEvent);
$(".ui-dialog-content").dialog("close");
}
},
cancel : function() {
$(".ui-dialog-content").dialog("close");
}
}
}).show();
$dialogContent.find(".date_holder").text($calendar.weekCalendar("formatDate", calEvent.start));
},