Skip to content

Commit

Permalink
fix(uiDateMask): return null should handle corner cases (#295)
Browse files Browse the repository at this point in the history
BREAKING CHANGE uiDateMask used to return the input value when empty now it will return null
  • Loading branch information
neysimoes authored and assisrafael committed Sep 23, 2017
1 parent 2612693 commit a8a0e04
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 @@ -29,7 +29,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 a8a0e04

Please sign in to comment.