Refactor #1627 worker.timeControl

This commit is contained in:
Bernat 2019-08-06 12:25:53 +02:00
parent 3d88d41bd0
commit 7e1eba53f1
2 changed files with 7 additions and 1 deletions

View File

@ -27,7 +27,7 @@
icon="arrow_{{($index % 2) == 0 ? 'forward' : 'back'}}"
title="{{(($index % 2) == 0 ? 'In' : 'Out') | translate}}">
</vn-icon>
<span class="chip notice">{{hour.timed | dateTime: 'HH:mm'}}</span>
<span class="chip {{$ctrl.hourColor(hour)}}">{{hour.timed | dateTime: 'HH:mm'}}</span>
</section>
</vn-td>
</vn-tr>

View File

@ -112,6 +112,12 @@ class Controller {
this.weekDays = weekdays;
}
hourColor(weekDay) {
if (weekDay.manual)
return 'alert';
return 'warning';
}
get weekOffset() {
const timed = this.defaultDate;
const weekDay = timed.getDay() == 0 ? 7 : timed.getDay();