this should probably just be new Date($scope.reportYear, $scope.reportMonth, $scope.currentDay) is there a reason to have it nested in a function in an object on stockCountFactory?