Filtered repeatedly adding 'All' in the shift list

parent 703a2b20
......@@ -4,7 +4,10 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
$scope.empName = myFactory.getEmpName();
$scope.empEmailId = myFactory.getEmpEmailId();
$scope.shifts = myFactory.getShifts();
$scope.shifts.unshift("All");
if($scope.shifts.indexOf("All") == "-1"){
$scope.shifts.unshift("All");
}
// Date picker related code
var today = new Date();
$scope.maxDate = today;
......
......@@ -71,7 +71,9 @@ myApp.controller("shiftDetailsController",function($scope, myFactory,exportUiGri
$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)"];
if($scope.shifts.indexOf("All") != "-1"){
$scope.shifts.shift();
}
var shiftV = $scope.shiftValue;
if(shiftV == undefined || shiftV==""){
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