話很少說上代碼後端
timeCal(time){
let endTime = Date.parse(new Date(time));
let nowTime = Date.parse(new Date());
let autoTime = (endTime-nowTime);
let days = parseInt(autoTime / (1000 * 60 * 60 * 24));
let hours = parseInt((autoTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
return days+"天"+hours+"小時";
},
複製代碼