Commit 596c479e authored by Soumya Gouri's avatar Soumya Gouri

Added date validation from UI side

parent 6e6ba294
...@@ -653,9 +653,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -653,9 +653,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
'Trainee' ] 'Trainee' ]
}, },
{ name: 'billingStartDate',width:"*", displayName: 'Start Date', enableColumnMenu: false, enableSorting: false , cellFilter:'date:"dd-MMM-yyyy"',enableFiltering:false,width:160, { name: 'billingStartDate',width:"*", displayName: 'Start Date', enableColumnMenu: false, enableSorting: false , cellFilter:'date:"dd-MMM-yyyy"',enableFiltering:false,width:160,
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="newBillingStartDate " name="newBillingStartDate"></md-datepicker></div>'}, cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="newBillingStartDate" name="newBillingStartDate" md-min-date="grid.appScope.minBillingDate" md-max-date="grid.appScope.maxBillingDate"></md-datepicker></div>'},
{ field: 'billingEndDate',width:"*", displayName: 'End Date', enableColumnMenu: false, enableSorting: false , cellFilter:'date:"dd-MMM-yyyy"',enableFiltering:false,width:160, { field: 'billingEndDate',width:"*", displayName: 'End Date', enableColumnMenu: false, enableSorting: false , cellFilter:'date:"dd-MMM-yyyy"',enableFiltering:false,width:160,
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="endDate " name="endDate"></md-datepicker></div>'}, cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="endDate" name="endDate" md-min-date="row.entity.billingStartDate" md-max-date="grid.appScope.maxBillingDate"></md-datepicker></div>'},
{name : 'Actions',width:"*", displayName: 'Actions',cellTemplate: getCellTemplate1, enableColumnMenu: false, enableSorting: false,enableFiltering: false,width:"*"} {name : 'Actions',width:"*", displayName: 'Actions',cellTemplate: getCellTemplate1, enableColumnMenu: false, enableSorting: false,enableFiltering: false,width:"*"}
] ]
}; };
...@@ -1862,5 +1862,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1862,5 +1862,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
return false; return false;
} }
$scope.minBillingDate = new Date($scope.projectStartDate);
$scope.maxBillingDate = new Date($scope.projectEndDate);
} }
}); });
<md-dialog aria-label="Team Details" style="height:auto;" class="md-dialog-custom-height viewTeamDetails" ng-init="getEmployeeDetails()" id="projectTeamDetails" > <md-dialog aria-label="Team Details" style="width:950px;height:auto;" class="md-dialog-custom-height" ng-init="getEmployeeDetails()" id="projectTeamDetails" >
<form ng-cloak name="myForm "> <form ng-cloak name="myForm ">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools " style="background: cadetblue; "> <div class="md-toolbar-tools " style="background: cadetblue; ">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<b>Project Start Date:</b> {{projectStartDate | date : 'dd-MMM-yyyy'}} <b>Project Start Date:</b> {{projectStartDate | date : 'dd-MMM-yyyy'}}
</p> </p>
<p> <p>
<b>Project End Date:</b> {{projectEndDate | date : 'dd-MMM-yyyy'}} <b>Project End Date:</b> {{projectEndDate | date : 'dd-MMM-yyyy'}}
</p> </p>
</div> </div>
<div class="col-xs-6 text-right "> <div class="col-xs-6 text-right ">
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
</div> </div>
</div> </div>
<div class="form-group col-lg-9 col-md-9 col-sm-9 col-xs-12"></div> <div class="form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"></div>
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<input type="radio" ng-model="status" value="Active" ng-click="getTeamMates()"> Active <input type="radio" ng-model="status" value="Active" ng-click="getTeamMates()"> Active
<input type="radio" ng-model="status" value="InActive" ng-click="getTeamMates()"> Inactive <input type="radio" ng-model="status" value="InActive" ng-click="getTeamMates()"> Inactive
<input type="radio" ng-model="status" value="Both" ng-click="getTeamMates()"> Both <input type="radio" ng-model="status" value="Both" ng-click="getTeamMates()"> Both
</div> </div>
<div id="gridTest" class="grid-half-view" ui-grid="gridOptions " ui-grid-edit ui-grid-pagination style="width:94.5%;margin-left:25px; "> <div id="gridTest" class="grid-half-view" ui-grid="gridOptions " ui-grid-edit ui-grid-pagination style="width:99%;height:230px;margin-left:10px; ">
<div class="watermark " ng-show="!gridOptions.data.length ">No data available</div> <div class="watermark " ng-show="!gridOptions.data.length ">No data available</div>
</div> </div>
<div ng-if ='templateTitle == "View"' role="alert"> <div ng-if ='templateTitle == "View"' role="alert">
...@@ -152,8 +152,8 @@ ...@@ -152,8 +152,8 @@
<tr ng-show="empBillableStatus"> <tr ng-show="empBillableStatus">
<td class="Employee">{{empBillableStatus}} Start Date </td> <td class="Employee">{{empBillableStatus}} Start Date </td>
<td> <td>
<md-datepicker ng-model="newBillingStartDate" md-placeholder="Please select Date " id="newBillingStartDate " md-min-date="minDate " <md-datepicker ng-model="newBillingStartDate" md-placeholder="Please select Date " id="newBillingStartDate " md-min-date="minBillingDate"
md-max-date="maxDate " onkeydown="return false " ng-change="currentBillabilityDateChange()" name="newBillingStartDate"></md-datepicker> md-max-date="maxBillingDate" onkeydown="return false " ng-change="currentBillabilityDateChange()" name="newBillingStartDate"></md-datepicker>
</td> </td>
</tr> </tr>
<!-- <tr> <!-- <tr>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<tr ng-show="empBillableStatus"> <tr ng-show="empBillableStatus">
<td class="Employee">{{empBillableStatus}} End Date</td> <td class="Employee">{{empBillableStatus}} End Date</td>
<td> <td>
<md-datepicker ng-model="endDate" md-placeholder="Please select Date" id="endDate " md-min-date="minDate " md-max-date="maxDate " <md-datepicker ng-model="endDate" md-placeholder="Please select Date" id="endDate " md-min-date="newBillingStartDate " md-max-date="maxBillingDate "
onkeydown="return false " name="endDate"></md-datepicker> onkeydown="return false " name="endDate"></md-datepicker>
</td> </td>
</tr> </tr>
......
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