Change return value to ngModel so that endDate is included in result value

Change this code:
       $scope.$apply(function () {
             ngModel.$setViewValue({ startDate: start.toDate(), endDate: end.toDate() });
        });			
To this:
       $scope.$apply(function () {
	    ngModel.$setViewValue({ startDate: start.toDate().setHours(0, 0, 0), endDate:   end.toDate().setHours(23, 59, 59) });
	});