/**
|
* 将秒转化成时:分
|
*
|
* @param {[Number]} value 分
|
*
|
* @return {[String]} 00h00m
|
*/
|
function formatMinutes(value = 0) {
|
if (value <= 0) {
|
value = 0;
|
}
|
// 分
|
var theTime = parseInt(value);
|
// 小时
|
var theTime1 = 0;
|
if (theTime >= 60) {
|
theTime1 = parseInt(theTime / 60);
|
theTime = parseInt(theTime % 60);
|
//alert(theTime1+"-"+theTime);
|
}
|
var result = (theTime < 10 ? "0" : "") + parseInt(theTime);
|
if (theTime1 >= 0) {
|
result = (theTime1 < 10 ? "0" : "") + parseInt(theTime1) + "h" + result + 'm';
|
}
|
return result;
|
}
|
|
export default formatMinutes;
|