Skip to content

Commit

Permalink
Cleanup tray
Browse files Browse the repository at this point in the history
  • Loading branch information
Maigo Erit committed Feb 29, 2016
1 parent 8db2674 commit f9e814f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 46 deletions.
1 change: 0 additions & 1 deletion plugins/tray/app/app.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ angular.module('trayApp', [
'trayApp.config',
'trayApp.runtime-config',
'pascalprecht.translate',
'js-data',
'mdColorPicker',
'ngMaterialDatePicker',
'md.data.table',
Expand Down
43 changes: 1 addition & 42 deletions plugins/tray/app/trackItem/trackItem.list.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,5 @@ angular.module('trayApp')
.controller('TrackItemListController', function (TrackItemService, $rootScope) {
var ctrl = this;

ctrl.maxDate = new Date();


function getTomorrow(d) {
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1)
}

var today = new Date();
var tomorrow = getTomorrow(today);
ctrl.searchDate = today;

today.setHours(0, 0, 0, 0);
console.log(today, tomorrow);


var PAGE_SIZE = 50;
var currentPage = 1;
ctrl.list = function () {
console.log("Refresh data");

TrackItemService.findAll({
offset: PAGE_SIZE * (currentPage - 1),
limit: PAGE_SIZE,
orderBy: [
['beginDate', 'DESC']
], where: {
beginDate: {
'>': ctrl.searchDate,
'<': getTomorrow(ctrl.searchDate)
}
}
}, {
keepChangeHistory: false,
cacheResponse: false
}).then(function (items) {
ctrl.trackItems = items;
$rootScope.$apply();
});
};

ctrl.list();


});
3 changes: 0 additions & 3 deletions plugins/tray/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
<script src="../../bower_components/angular-aria/angular-aria.js"></script>
<script src="../../bower_components/angular-material/angular-material.js"></script>
<script src="../../bower_components/angular-translate/angular-translate.min.js"></script>
<script src="../../bower_components/js-data/dist/js-data.min.js"></script>
<script src="../../bower_components/js-data-localstorage/dist/js-data-localstorage.min.js"></script>
<script src="../../bower_components/js-data-angular/dist/js-data-angular.min.js"></script>
<script src="../../bower_components/jQuery/dist/jquery.js"></script>
<script src="../../bower_components/tinycolor/tinycolor.js"></script>
<script src="../../bower_components/angular-dynamic-locale/tmhDynamicLocale.min.js"></script>
Expand Down

0 comments on commit f9e814f

Please sign in to comment.