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

Commit

Permalink
feat(dateparser): remove deprecated code
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove deprecated non-prefixed service

Closes #4718
  • Loading branch information
Foxandxss authored and wesleycho committed Oct 23, 2015
1 parent b159b21 commit 2d68f41
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
14 changes: 0 additions & 14 deletions src/dateparser/dateparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,3 @@ angular.module('ui.bootstrap.dateparser', [])
return true;
}
}]);

/* Deprecated dateparser below */

angular.module('ui.bootstrap.dateparser')

.value('$dateParserSuppressWarning', false)

.service('dateParser', ['$log', '$dateParserSuppressWarning', 'uibDateParser', function($log, $dateParserSuppressWarning, uibDateParser) {
if (!$dateParserSuppressWarning) {
$log.warn('dateParser is now deprecated. Use uibDateParser instead.');
}

angular.extend(this, uibDateParser);
}]);
31 changes: 0 additions & 31 deletions src/dateparser/test/dateparser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,34 +224,3 @@ describe('date parser', function() {
expect(dateParser.init).toHaveBeenCalled();
}));
});

/* Deprecation tests below */

describe('date parser deprecation', function() {
beforeEach(module('ui.bootstrap.dateparser'));

it('should suppress warning', function() {
module(function($provide) {
$provide.value('$dateParserSuppressWarning', true);
});

inject(function($log, dateParser) {
spyOn($log, 'warn');

dateParser.parse('01.10.2015', 'dd.MM.yyyy');

expect($log.warn.calls.count()).toBe(0);
});
});

it('should give warning by default', inject(function($log) {
spyOn($log, 'warn');

inject(function(dateParser) {
dateParser.parse('01.10.2015', 'dd.MM.yyyy');

expect($log.warn.calls.count()).toBe(1);
expect($log.warn.calls.argsFor(0)).toEqual(['dateParser is now deprecated. Use uibDateParser instead.']);
});
}));
});

0 comments on commit 2d68f41

Please sign in to comment.