/**
 * 时间戳转 时分秒(判断工时)
 * @param {Object} data 时间戳
 * @param {Object} flag 是否返回 HH:mm:ss 格式
 */
// listData.value[i].taskTime = (timeStamp / 3600000).toFixed(2) === 'NaN' ? 0 : (timeStamp / 3600000)
// 	.toFixed(2);
export function toHHmmss(data, flag = true) {
	let time;
	let hours = parseInt((data % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
	let minutes = parseInt((data % (1000 * 60 * 60)) / (1000 * 60));
	let seconds = (data % (1000 * 60)) / 1000;
	if (flag) {
		time = `${hours}小时${minutes}分钟${seconds}秒`;
	} else {
		time = (hours < 10 ? ('0' + hours) : hours) + ':' + (minutes < 10 ? ('0' + minutes) : minutes) + ':' + (
			seconds <
			10 ? ('0' + seconds) : seconds);
	}
	return time;
}
