test the databind for some of the timelog properties with the new Flattened TimeLogList object.

added convertToHours method to spa.js to enable WeeklyTotal(mins) to be converted to hours for ui.
#15
This commit is contained in:
Chris.Watts90@outlook.com 2017-02-15 16:53:06 +00:00
parent 59e27c2991
commit 79f5e392e9
2 changed files with 6 additions and 4 deletions

View File

@ -205,7 +205,6 @@
</div> </div>
<div class="col-md-9 col-xs-12 well"> <div class="col-md-9 col-xs-12 well">
<!-- main content panel. --> <!-- main content panel. -->
<label data-bind="text: CalendarWeek"></label>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -222,8 +221,8 @@
<tbody> <tbody>
<!-- ko foreach: TimeLogs--> <!-- ko foreach: TimeLogs-->
<tr> <tr>
<td class="valign">Monday</td> <td class="valign" data-bind="text: DayOfWeek"></td>
<td class="valign" data-bind="text: TimeLogCount"></td> <td class="valign" data-bind="text: DailyTotal"></td>
<td class="valign"></td> <td class="valign"></td>
<td class="valign"></td> <td class="valign"></td>
<td class="valign"></td> <td class="valign"></td>
@ -234,7 +233,7 @@
<!-- /ko --> <!-- /ko -->
<tr> <tr>
<td class="valign" colspan="7" for="monday">Weekly Total</td> <td class="valign" colspan="7" for="monday">Weekly Total</td>
<td class="valign" for="dailyHrsTotal" data-bind="rext: WeeklyTotal"></td> <td class="valign" for="dailyHrsTotal" data-bind="text: $root.convertToHours(WeeklyTotal)"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -129,6 +129,9 @@
console.log("target is null, going nowhere"); console.log("target is null, going nowhere");
} }
}; };
self.convertToHours = function(value) {
return value / 60;
}
self.dismissAlert = function(data, event) { self.dismissAlert = function(data, event) {
self.errorData(null); self.errorData(null);
}; };