fixes #13 for time > 24h

This commit is contained in:
Stefan Dej 2020-05-09 02:12:42 +02:00
parent d2bccb737e
commit abea5d8660

View File

@ -153,10 +153,12 @@
this.$socket.sendObj('post_printer_print_cancel', { }, 'setLoadingPrintCancel'); this.$socket.sendObj('post_printer_print_cancel', { }, 'setLoadingPrintCancel');
}, },
formatTime(seconds) { formatTime(seconds) {
let date = new Date(null); let h = Math.floor(seconds / 3600);
date.setSeconds(seconds); seconds %= 3600;
let m = Math.floor(seconds / 60);
let s = seconds % 60;
return date.toISOString().substr(11,8); return h+':'+m+':'+s;
}, },
}, },
} }