Skip to content

Commit

Permalink
fix(uiDateMask): return null should handle corner cases
Browse files Browse the repository at this point in the history
  • Loading branch information
neysimoes committed Aug 2, 2017
1 parent 3854362 commit b851e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/global/date/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function DateMaskDirective($locale) {

function formatter(value) {
if (ctrl.$isEmpty(value)) {
return value;
return null;
}

var cleanValue = value;
Expand Down
2 changes: 1 addition & 1 deletion src/global/date/date.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}));
});

0 comments on commit b851e54

Please sign in to comment.