Filtered repeatedly adding 'All' in the shift list

parent 703a2b20
...@@ -4,7 +4,10 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory ...@@ -4,7 +4,10 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
$scope.empName = myFactory.getEmpName(); $scope.empName = myFactory.getEmpName();
$scope.empEmailId = myFactory.getEmpEmailId(); $scope.empEmailId = myFactory.getEmpEmailId();
$scope.shifts = myFactory.getShifts(); $scope.shifts = myFactory.getShifts();
$scope.shifts.unshift("All"); if($scope.shifts.indexOf("All") == "-1"){
$scope.shifts.unshift("All");
}
// Date picker related code // Date picker related code
var today = new Date(); var today = new Date();
$scope.maxDate = today; $scope.maxDate = today;
......
...@@ -71,7 +71,9 @@ myApp.controller("shiftDetailsController",function($scope, myFactory,exportUiGri ...@@ -71,7 +71,9 @@ myApp.controller("shiftDetailsController",function($scope, myFactory,exportUiGri
$scope.getShiftDetails = function(){ $scope.getShiftDetails = function(){
$scope.shifts = myFactory.getShifts(); //["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"]; $scope.shifts = myFactory.getShifts(); //["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
if($scope.shifts.indexOf("All") != "-1"){
$scope.shifts.shift();
}
var shiftV = $scope.shiftValue; var shiftV = $scope.shiftValue;
if(shiftV == undefined || shiftV==""){ if(shiftV == undefined || shiftV==""){
shiftV="Shift 1(9:00 AM - 6:00 PM)"; shiftV="Shift 1(9:00 AM - 6:00 PM)";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment