這很瘋狂,我不知道爲什麼!?奇數陣列值問題
這裏是我的問題:
當我登錄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('========================');
,這就是我得到:
的console.log(calEvent 。開始)
Fri Oct 25 2013 12:30:00 GMT-0400 (EDT)
的console.log(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
任何想法爲什麼發生這種情況? :(
注:我的英語*
=========================對不起[CODE那一套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));
},
你說:「正如你可以看到calEvent.start顯示正確的時間12:30:00,但calEvent.start顯示時間爲00:00:00」它如何顯示兩個不同的時間? –
對不起,錯字:'calEvent.start'顯示正確的時間** 12:30:00 **但是'calEvent'顯示時間爲** 00:00:00 ** –
您是否使用任何插件?如果您是,請添加標籤。 –