New validation as per requirement

parent df3921de
...@@ -352,8 +352,17 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -352,8 +352,17 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
return obj; return obj;
}; };
var today = new Date();
$scope.addTab = function () { $scope.addTab = function () {
if(! (new Date(dataToPass.projectEndDate) > today) ){
$mdDialog.show($mdDialog.alert({
skipHide: true,
title:"Attention",
textContent: 'Employee cannot be add to completed Project',
ok: 'ok'
}));
}
else{
if($scope.isSecondTab === false){ if($scope.isSecondTab === false){
$scope.templateTitle = "Add"; $scope.templateTitle = "Add";
$scope.employeeRole = undefined; $scope.employeeRole = undefined;
...@@ -372,6 +381,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -372,6 +381,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.selectedTab = 1; $scope.selectedTab = 1;
$scope.searchTerm = ""; $scope.searchTerm = "";
} }
}
}; };
var removeTab = function (action) { var removeTab = function (action) {
if(action == "Add"){ if(action == "Add"){
......
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