<label>[% l('Selected Paid:') %]</label>
<span>{{totals.selected_paid() | currency}}</span>
</div>
- <div class="col-md-1">
- <span><button class="btn btn-default"
- ng-click="actions.apply_date_range()">[% l('Apply') %]</button></span>
- </div>
<div class="col-md-4 flex-row padded">
<label>[% l('Start Date:') %]</label>
<div><eg-date-input ng-model="dates.xact_start"></eg-date-input></div>
setQuery : current_grid_query
}
+ $scope.$watch('dates.xact_start', function(new_date, old_date) {
+ if (new_date !== old_date && new_date) {
+ if (new_date.getTime() > $scope.dates.xact_finish.getTime()) {
+ $scope.dates.xact_finish = new_date;
+ } else {
+ $scope.actions.apply_date_range();
+ }
+ }
+ });
+ $scope.$watch('dates.xact_finish', function(new_date, old_date) {
+ if (new_date !== old_date && new_date) {
+ if (new_date.getTime() < $scope.dates.xact_start.getTime()) {
+ $scope.dates.xact_start = new_date;
+ } else {
+ $scope.actions.apply_date_range();
+ }
+ }
+ });
+
$scope.actions.apply_date_range = function() {
// tells the grid to re-draw itself with the new query
$scope.gridControls.setQuery(current_grid_query());
setQuery : current_grid_query
}
+ $scope.$watch('dates.xact_start', function(new_date, old_date) {
+ if (new_date !== old_date && new_date) {
+ if (new_date.getTime() > $scope.dates.xact_finish.getTime()) {
+ $scope.dates.xact_finish = new_date;
+ } else {
+ $scope.actions.apply_date_range();
+ }
+ }
+ });
+ $scope.$watch('dates.xact_finish', function(new_date, old_date) {
+ if (new_date !== old_date && new_date) {
+ if (new_date.getTime() < $scope.dates.xact_start.getTime()) {
+ $scope.dates.xact_start = new_date;
+ } else {
+ $scope.actions.apply_date_range();
+ }
+ }
+ });
+
$scope.actions.apply_date_range = function() {
// tells the grid to re-draw itself with the new query
$scope.gridControls.setQuery(current_grid_query());