From b851e549a0a0539260706f21867d88e77489c86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ney=20Sim=C3=B5es?= Date: Wed, 2 Aug 2017 15:03:13 -0300 Subject: [PATCH] fix(uiDateMask): return null should handle corner cases --- src/global/date/date.js | 2 +- src/global/date/date.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/global/date/date.js b/src/global/date/date.js index e4a7449e..4ae8678d 100644 --- a/src/global/date/date.js +++ b/src/global/date/date.js @@ -28,7 +28,7 @@ function DateMaskDirective($locale) { function formatter(value) { if (ctrl.$isEmpty(value)) { - return value; + return null; } var cleanValue = value; diff --git a/src/global/date/date.test.js b/src/global/date/date.test.js index 5baebc9b..abc73505 100644 --- a/src/global/date/date.test.js +++ b/src/global/date/date.test.js @@ -86,7 +86,7 @@ describe('ui-date-mask', function() { tests.forEach(function(test) { $rootScope.model = test.modelValue; $rootScope.$digest(); - expect(model.$viewValue).toBe(test.viewValue); + expect(model.$viewValue).toBe(null); }); })); });