Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.

Validate the date object using the modelValue #94

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ angular.module('ui.date', [])

// Update the date picker when the model changes
controller.$render = function () {
var date = controller.$viewValue;
var date = controller.$modelValue;
if ( angular.isDefined(date) && date !== null && !angular.isDate(date) ) {
throw new Error('ng-Model value must be a Date object - currently it is a ' + typeof date + ' - use ui-date-format to convert it from a string');
}
Expand Down