2014-11-06 132 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

相关问题