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

Commit 2d68f41

Browse files
Foxandxsswesleycho
authored andcommitted
feat(dateparser): remove deprecated code
BREAKING CHANGE: Remove deprecated non-prefixed service Closes #4718
1 parent b159b21 commit 2d68f41

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/dateparser/dateparser.js

-14
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,3 @@ angular.module('ui.bootstrap.dateparser', [])
217217
return true;
218218
}
219219
}]);
220-
221-
/* Deprecated dateparser below */
222-
223-
angular.module('ui.bootstrap.dateparser')
224-
225-
.value('$dateParserSuppressWarning', false)
226-
227-
.service('dateParser', ['$log', '$dateParserSuppressWarning', 'uibDateParser', function($log, $dateParserSuppressWarning, uibDateParser) {
228-
if (!$dateParserSuppressWarning) {
229-
$log.warn('dateParser is now deprecated. Use uibDateParser instead.');
230-
}
231-
232-
angular.extend(this, uibDateParser);
233-
}]);

src/dateparser/test/dateparser.spec.js

-31
Original file line numberDiff line numberDiff line change
@@ -224,34 +224,3 @@ describe('date parser', function() {
224224
expect(dateParser.init).toHaveBeenCalled();
225225
}));
226226
});
227-
228-
/* Deprecation tests below */
229-
230-
describe('date parser deprecation', function() {
231-
beforeEach(module('ui.bootstrap.dateparser'));
232-
233-
it('should suppress warning', function() {
234-
module(function($provide) {
235-
$provide.value('$dateParserSuppressWarning', true);
236-
});
237-
238-
inject(function($log, dateParser) {
239-
spyOn($log, 'warn');
240-
241-
dateParser.parse('01.10.2015', 'dd.MM.yyyy');
242-
243-
expect($log.warn.calls.count()).toBe(0);
244-
});
245-
});
246-
247-
it('should give warning by default', inject(function($log) {
248-
spyOn($log, 'warn');
249-
250-
inject(function(dateParser) {
251-
dateParser.parse('01.10.2015', 'dd.MM.yyyy');
252-
253-
expect($log.warn.calls.count()).toBe(1);
254-
expect($log.warn.calls.argsFor(0)).toEqual(['dateParser is now deprecated. Use uibDateParser instead.']);
255-
});
256-
}));
257-
});

0 commit comments

Comments
 (0)