Исправил досадную ошибку

This commit is contained in:
Anton Vakhrushev 2020-03-02 22:53:11 +03:00
parent a002d130e0
commit e88005be78

View File

@ -10,7 +10,7 @@
<td class="date">{{ item.date }}</td>
<td class="planned">{{ item.planned.total_minutes | tt }}</td>
<td class="worked">{{ item.worked.total_minutes | tt }}</td>
<td class="worked">
<td class="difference">
{{ (item.worked.total_minutes - item.planned.total_minutes) | td }}
</td>
</tr>
@ -38,14 +38,14 @@ export default {
},
filters: {
tt(v) {
const h = Math.round(v / 60);
const h = Math.floor(v / 60);
const m = v % 60;
return (h ? h : '00') + ':' + String(m).padStart(2, '0');
},
td(v) {
const o = v > 0;
const a = Math.abs(v);
const h = Math.round(a / 60);
const h = Math.floor(a / 60);
const m = a % 60;
const t = (h ? h : '00') + ':' + String(m).padStart(2, '0');
return (o ? '+' : '-') + t;
@ -68,7 +68,8 @@ export default {
.date,
.planned,
.worked {
.worked,
.difference {
text-align: center;
}
}