Cleaned up date manipulation code. Updated data mapping to use ko.toJS.
This commit is contained in:
@ -103,12 +103,12 @@
|
||||
|
||||
<script id="itemsTmpl" type="text/html">
|
||||
<tr data-bind="css: { 'error': sold() < 0 }">
|
||||
<td data-bind="date: value_date"></td>
|
||||
<td data-bind="date: operation_date"></td>
|
||||
<td data-bind="text: value_date"></td>
|
||||
<td data-bind="text: operation_date"></td>
|
||||
<td data-bind="text: label"></td>
|
||||
<td data-bind="text: value, css: {'text-error': value() < 0 }"></td>
|
||||
<td data-bind="text: sold, css: {'text-error': sold() < 0 }"></td>
|
||||
<td data-bind="text: pointedSold, css: {'text-error': pointedSold() < 0 }"></td>
|
||||
<td data-bind="text: operation_date() ? pointedsold : '', css: {'text-error': operation_date() && pointedsold() < 0 }"></td>
|
||||
<td data-bind="text: category"></td>
|
||||
<td class="buttons">
|
||||
<a class="btn btn-mini" data-bind="click: $root.edit" href="#" title="edit"><i class="icon-edit"></i></a>
|
||||
@ -119,12 +119,12 @@
|
||||
|
||||
<script id="editTmpl" type="text/html">
|
||||
<tr data-bind="css: { 'error': sold() < 0 }">
|
||||
<td><input type="text" class="input-small" data-bind="dateValue: value_date" data-date-format="yyyy-mm-dd" id="value_date"/></td>
|
||||
<td><div class="input-append"><input type="text" class="input-small" data-bind="dateValue: operation_date" data-date-format="yyyy-mm-dd" id="operation_date"/><button class="btn" type="button"><i class="icon-remove" id="operation_date_clear"></i></button></div></td>
|
||||
<td><div class="date"><input type="text" class="input-small" data-bind="value: value_date" data-date-format="yyyy-mm-dd" id="value_date"></input></div></td>
|
||||
<td><div class="input-append date"><input type="text" class="input-small" data-bind="value: operation_date" data-date-format="yyyy-mm-dd" id="operation_date"></input><button class="btn" type="button" data-bind="click: function(item) { item.operation_date(null)}"><i class="icon-remove"></i></button></div></td>
|
||||
<td><input type="text" class="input-xxlarge" data-bind="value: label"/></td>
|
||||
<td><input type="text" class="input-mini" data-bind="value: value"/></td>
|
||||
<td data-bind="text: sold"></td>
|
||||
<td data-bind="text: pointedSold"></td>
|
||||
<td data-bind="text: pointedsold"></td>
|
||||
<td><input type="text" class="input-small" data-bind="value: category"/></td>
|
||||
<td class="buttons">
|
||||
<a class="btn btn-mini btn-success" data-bind="click: $root.save" href="#" title="save"><i class="icon-ok"></i></a>
|
||||
@ -136,7 +136,10 @@
|
||||
<script type="text/javascript" src="jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="datepicker/js/bootstrap-datepicker.js"></script>
|
||||
|
||||
<script type="text/javascript" src="knockout/knockout.js"></script>
|
||||
<script type="text/javascript" src="knockout/knockout-mapping.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="jqplot/jquery.jqplot.js"></script>
|
||||
<script type="text/javascript" src="jqplot/plugins/jqplot.dateAxisRenderer.js"></script>
|
||||
<script type="text/javascript" src="jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>
|
||||
@ -147,6 +150,7 @@
|
||||
<script type="text/javascript" src="jqplot/plugins/jqplot.highlighter.min.js"></script>
|
||||
<script type="text/javascript" src="jqplot/plugins/jqplot.canvasOverlay.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="js/date.js"></script>
|
||||
<script type="text/javascript" src="js/entries.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user