Changeset 12778 for branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients
- Timestamp:
- 07/20/15 13:49:39 (9 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientDetails.cshtml
r12768 r12778 195 195 <label for="fromDate">To: </label> 196 196 <div class="input-group"> 197 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" 197 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close"/> 198 198 <span class="input-group-btn"> 199 199 <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button> 200 200 </span> 201 </div> 202 </div> 203 <div class="form-group" style="margin-left: 5px; margin-right: 5px;"> 204 <div class="btn-group" dropdown dropdown-append-to-body> 205 <button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle style="width: 130px; text-align: left;"> 206 <span class="text-left" style="display: inline-block; width: 85px;">{{curQuickSelection.name}}</span> 207 <span class="glyphicon glyphicon-chevron-down" style="margin-top: 3px;"></span> 208 </button> 209 <ul class="dropdown-menu" role="menu"> 210 <li ng-repeat="quickSelection in quickSelectionList"> 211 <a class="cursor-pointer" ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a> 212 </li> 213 </ul> 201 214 </div> 202 215 </div> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientDetailsCtrl.js
r12584 r12778 171 171 $scope.toIsOpen = false; 172 172 173 $scope.quickSelectionList = [ 174 { id: 0, name: 'Custom' }, 175 { id: 1, name: 'Today' }, 176 { id: 2, name: 'Yesterday' }, 177 { id: 3, name: 'Last 7 Days' }, 178 { id: 4, name: 'Last 30 Days' } 179 ]; 180 $scope.changeQuickSelection = function (quickSelection) { 181 var today = new Date(); 182 var oneDayInMs = 24 * 60 * 60 * 1000; 183 switch (quickSelection.id) { 184 case 1: 185 $scope.fromDate = new Date(today.valueOf()); 186 $scope.toDate = new Date(today.valueOf()); 187 break; 188 case 2: 189 $scope.fromDate = new Date(today.valueOf() - oneDayInMs); 190 $scope.toDate = new Date(today.valueOf() - oneDayInMs); 191 break; 192 case 3: 193 $scope.fromDate = new Date(today.valueOf() - (7 * oneDayInMs)); 194 $scope.toDate = new Date(today.valueOf()); 195 break; 196 case 4: 197 $scope.fromDate = new Date(today.valueOf() - (30 * oneDayInMs)); 198 $scope.toDate = new Date(today.valueOf()); 199 break; 200 } 201 $scope.curQuickSelection = quickSelection; 202 }; 203 // set default 'today' 204 $scope.changeQuickSelection($scope.quickSelectionList[1]); 205 173 206 $scope.openFromDateSelection = function ($event) { 174 207 $event.preventDefault(); … … 176 209 $scope.toIsOpen = false; 177 210 $scope.fromIsOpen = true; 211 $scope.curQuickSelection = $scope.quickSelectionList[0]; 178 212 }; 179 213 … … 183 217 $scope.fromIsOpen = false; 184 218 $scope.toIsOpen = true; 219 $scope.curQuickSelection = $scope.quickSelectionList[0]; 185 220 }; 186 221
Note: See TracChangeset
for help on using the changeset viewer.