...
|
...
|
@@ -85,26 +85,33 @@ function formatNumber(n) { |
|
|
*/
|
|
|
function formatTimeByMin(time, format) {
|
|
|
|
|
|
var formateArr = ['00'];
|
|
|
var formateArr = ['m', 's'];
|
|
|
var returnArr = [];
|
|
|
var int_day, int_hour, int_minute, int_second;
|
|
|
time = time * 1000;
|
|
|
if (time >= 0) {
|
|
|
// int_day = Math.floor(time / 86400000)
|
|
|
// time -= int_day * 86400000;
|
|
|
// int_hour = Math.floor(time / 3600000)
|
|
|
// time -= int_hour * 3600000;
|
|
|
int_minute = Math.floor(time / 60000)
|
|
|
time -= int_minute * 60000;
|
|
|
int_second = Math.floor(time / 1000)
|
|
|
}
|
|
|
// returnArr.push(formatNumber(int_day));
|
|
|
// returnArr.push(formatNumber(int_hour));
|
|
|
returnArr.push(formatNumber(int_minute));
|
|
|
returnArr.push(formatNumber(int_second));
|
|
|
var date = new Date(time * 1000);
|
|
|
|
|
|
returnArr.push(formatNumber(date.getMinutes()));
|
|
|
returnArr.push(formatNumber(date.getSeconds()));
|
|
|
// if (time >= 0) {
|
|
|
// // int_day = Math.floor(time / 86400000)
|
|
|
// // time -= int_day * 86400000;
|
|
|
// // int_hour = Math.floor(time / 3600000)
|
|
|
// // time -= int_hour * 3600000;
|
|
|
// int_minute = Math.floor(time / 60000)
|
|
|
// if (time < 60000) {
|
|
|
// int_minute = Math.floor(0);
|
|
|
// } else {
|
|
|
// time -= int_minute * 60000;
|
|
|
// }
|
|
|
// int_second = Math.floor(time / 1000)
|
|
|
// }
|
|
|
// // returnArr.push(formatNumber(int_day));
|
|
|
// // returnArr.push(formatNumber(int_hour));
|
|
|
// returnArr.push(formatNumber(int_minute));
|
|
|
// returnArr.push(formatNumber(int_second));
|
|
|
|
|
|
for (var i in returnArr) {
|
|
|
format = format.replace(formateArr[0], returnArr[i]);
|
|
|
format = format.replace(formateArr[i], returnArr[i]);
|
|
|
}
|
|
|
return format;
|
|
|
}
|
...
|
...
|
|