small refactor

This commit is contained in:
Carlos Jimenez Ruiz 2020-11-11 12:02:40 +01:00
parent e22e74a725
commit c2f92cb127
2 changed files with 7 additions and 9 deletions

View File

@ -52,8 +52,8 @@
{{::order.landed | date:'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td shrink>{{::order.hourTheoretical | dashIfEmpty}}</vn-td>
<vn-td shrink>{{::ticket.hourEffective | dashIfEmpty}}</vn-td>
<vn-td shrink>{{::order.hourTheoretical | date: 'HH:mm' | dashIfEmpty}}</vn-td>
<vn-td shrink>{{::ticket.hourEffective | date: 'HH:mm' | dashIfEmpty}}</vn-td>
<vn-td number>{{::order.total | currency: 'EUR': 2 | dashIfEmpty}}</vn-td>
<vn-td shrink>
<vn-icon-button

View File

@ -10,15 +10,13 @@ export default class Controller extends Section {
compareDate(date) {
let today = new Date();
today.setHours(0, 0, 0, 0);
let timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0);
let comparation = today - timeTicket;
date = new Date(date);
date.setHours(0, 0, 0, 0);
if (comparation == 0)
return 'warning';
if (comparation < 0)
return 'success';
const timeDifference = today - date;
if (timeDifference == 0) return 'warning';
if (timeDifference < 0) return 'success';
}
}