From ee6fa881f6c32fecbe8e08908d98df70f3f2fe98 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 23 Sep 2014 22:31:46 +0200 Subject: [PATCH] Validate the date object using the modelValue This fixes one of the two tests that fail when switching to angular#1.3.0-rc.2. The viewValue returns a string value each time but the modelValue returns the object version. The tests also pass for angular 1.2.25. --- src/date.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/date.js b/src/date.js index 38c6467..1bbbb63 100644 --- a/src/date.js +++ b/src/date.js @@ -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'); }