2014-11-06 134 views

回答

0

在文件JW-JQM-cal.js

添加此功能:

function tConvert (time) { 
     // Check correct time format and split into components 
     time = time.toString().match (/^([01]\d|2[0-3])(:)([0-5]\d)(:[0-5]\d)?$/) || [time]; 

     if (time.length > 1) { // If time format correct 
     time = time.slice (1); // Remove full string match value 
     time[5] = +time[0] < 12 ? ' AM' : ' PM'; // Set AM/PM 
     time[0] = +time[0] % 12 || 12; // Adjust hours 
     } 
     return time.join (''); // return adjusted time or original string 
} 

和在功能plugin.settings.eventHandler插入此2線 .getEventsOnDay(開始,結束,函數(list_of_events)

beginTime =tConvert(beginTime); 
endTime=tConvert(endTime); 

EDIT

插入之前: TIMESTRING = BEGINTIME + 「 - 」 +結束時間:**

...

BEGINTIME = tConvert(BEGINTIME);

endTime = tConvert(endTime);

TIMESTRING = BEGINTIME + 「 - 」 +結束時間,

...

+0

我在函數plugin.settings.eventHandler.getEventsOnDay(begin,end,function(list_of_events)下面放了2行。http://jsfiddle.net/L9odmhvb/。它沒有改變任何東西。我把代碼放在 – Siren 2014-11-06 03:11:29

+0

insert before:timeString = beginTime +「 - 」+ endTime – dm4web 2014-11-06 03:33:56

+0

sweet。謝謝!:) – Siren 2014-11-06 03:39:21

相關問題