Commit 754a525b97c657c57d081b5cff90341704fb5113

Authored by Anchit Jindal
1 parent cefbd3ffaa
Exists in master

fixed schedular issues

Showing 1 changed file with 7 additions and 24 deletions   Show diff stats
app/partials/scheduler/scheduler.controller.js
... ... @@ -12,39 +12,18 @@ angular.module('acufuel')
12 12 $scope.events = [];
13 13 function getEventsList(){
14 14 schedulerService.getEvents().then(function(result) {
15   - //console.log('----kd events-------',result);
16   - //console.log("==length===",result.length);
17 15  
18 16 for (var i = 0; i < result.length; i++) {
19   - var newTime = new Date(result[i].deployDate);
20   - // console.log("deployDate",result[i].deployDate)
21   - var dmonth = newTime.getUTCMonth() + 1; //months from 1-12
22   - var dday = newTime.getUTCDate();
23   - var dyear = newTime.getUTCFullYear();
24   -/*
25   - $scope.events.push({
26   - 'id': result[i].id,
27   - 'title': result[i].aircraft +',\n' + result[i].make +'/' + result[i].model +',\n' + result[i].requestedVolume +',' +result[i].priceQuote,
28   - 'start': dyear+'-'+dmonth+'-'+dday
29   -
30   - })*/
31 17 $scope.events.push({
32 18 'id': result[i].id,
33 19 'title': result[i].aircraft +'\n' + '(' + result[i].make +'/' + result[i].model + ')' + '\n' + 'for' + ' ' + result[i].requestedVolume + ' ' + 'gal.' + ' ' +'@' + ' ' +'$'+result[i].priceQuote,
34   - 'start': dyear+'-'+dmonth+'-'+dday
  20 + 'start': result[i].deployDate
35 21  
36 22 })
37   - // $scope.showEventsList();
38 23 $scope.showLoader = false;
39   -
40 24 }
41 25  
42 26 $('#my-calendar').fullCalendar('removeEvents');
43   - $('#my-calendar').fullCalendar('addEventSource',$scope.events);
44   - // $scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
45   -
46   - // console.log('==eventSource are====',$scope.eventSources);
47   - // $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear;
48 27 })
49 28 }
50 29  
... ... @@ -131,7 +110,11 @@ $scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
131 110 var dmonth = event.start._d.getUTCMonth() + 1; //months from 1-12
132 111 var dday = event.start._d.getUTCDate();
133 112 var dyear = event.start._d.getUTCFullYear();
134   - //console.log('date', dyear+'-'+dmonth+'-'+dday);
  113 + var setDeploy = new Date();
  114 + var hours = setDeploy.getHours();
  115 + var min = setDeploy.getMinutes();
  116 + var sec = setDeploy.getSeconds();
  117 +
135 118 for (var i = 0; i < $scope.events.length; i++) {
136 119 if ($scope.events[i].id == event.id) {
137 120  
... ... @@ -141,7 +124,7 @@ $scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
141 124 $scope.updatedDataDrop = {};
142 125 $scope.updatedDataDrop.id = $scope.events[i].id;
143 126 $scope.updatedDataDrop.aircraft = $scope.events[i].title;
144   - $scope.updatedDataDrop.deployDate = dyear+'-'+dmonth+'-'+dday;
  127 + $scope.updatedDataDrop.deployDate = dyear+'-'+dmonth+'-'+dday + ' ' + hours + ':' + min + ':' + sec;
145 128 if ($scope.updatedDataDrop.deployDate != undefined) {
146 129 $scope.updatedDataDrop.deployDate = new Date($scope.updatedDataDrop.deployDate);
147 130 $scope.updatedDataDrop.deployDate = $scope.updatedDataDrop.deployDate.getTime();
... ...