Nepethya Rana

Nepethya Rana

  • NA
  • 335
  • 151.9k

How do i filter my list by date ?

Jul 14 2017 2:39 AM
This is what i have written. It works for other properties with data type integer but it did not work in here for date. 
 
LogedDate is saved as 'Date type in db. which is in format 07-14-2017 
 
 
$scope.OnLogInDateChange = function (ComparerItem, DateValueFromJQueryDatePicker) {
$scope.LogFiles= $scope.allLogFiles;
let newArray = [];
switch (ComparerItem) {
case '=':
newArray = $scope.LogFiles.filter(r => r.LogedDate == DateValueFromJQueryDatePicker)
break;
case '>=':
newArray = $scope.LogFiles.filter(r => r.LogedDate >= DateValueFromJQueryDatePicker)
debugger;
break;
case '<=':
newArray = $scope.LogFiles.filter(r => r.LogedDate <= DateValueFromJQueryDatePicker)
debugger;
break;
}
$scope.LogFiles= newArray;
}
 

Answers (1)