使用js方法将要处理的秒数处理为时分秒的格式
second(value) {
var theTime = parseInt(value);// 秒
var middle= 0;// 分
var hour= 0;// 小时
if(theTime >= 60) {
middle= parseInt(theTime/60);
theTime = parseInt(theTime%60);
if(middle>= 60) {
hour= parseInt(middle/60);
middle= parseInt(middle%60);
}
}
var result = ""+parseInt(theTime)+"秒";
if(middle > 0) {
result = ""+parseInt(middle)+"分"+result;
}
if(hour> 0) {
result = ""+parseInt(hour)+"小时"+result;
}
return result;
}