Skip to content

Commit e389766

Browse files
committed
Add completion time estimate
1 parent a2b3071 commit e389766

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

public/assets/js/picoreflow.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,15 @@ $(document).ready(function()
556556

557557
left = parseInt(x.totaltime-x.runtime);
558558
eta = new Date(left * 1000).toISOString().substr(11, 8);
559+
const now = new Date();
560+
const eta_time = (new Date(now.getTime() + (left - now.getTimezoneOffset() * 60) * 1000)).toISOString().substring(11, 19);
559561

560562
updateProgress(parseFloat(x.runtime)/parseFloat(x.totaltime)*100);
561-
$('#state').html('<span class="glyphicon glyphicon-time" style="font-size: 22px; font-weight: normal"></span><span style="font-family: Digi; font-size: 40px;">' + eta + '</span>');
563+
$('#state').html(
564+
'<span class="glyphicon glyphicon-time" style="font-size: 22px; font-weight: normal"></span> ' +
565+
'<span style="font-family: Digi; font-size: 40px;">' + eta + '</span> ' +
566+
'<span class="glyphicon glyphicon-info-sign" style="font-size: 22px; font-weight: normal" ' +
567+
'title="Estimated completion time: '+eta_time+'"></span></span>');
562568
$('#target_temp').html(parseInt(x.target));
563569
$('#cost').html(x.currency_type + parseFloat(x.cost).toFixed(2));
564570

0 commit comments

Comments
 (0)