mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix(dateFilter): correctly format ISODates on Android<=2.1
In older Android browsers, `undefined` does not act like `0` in some arithmetic operations. This leads to dates being formatted with `NaN` strings in the dateFilter because the implementation of the `dateGetter` function allows offset to be an optional parameter. The fix is to convert offset to 0 if it is undefined. Closes #2277, #2275
This commit is contained in:
parent
52c1498e25
commit
f046f6f73c
1 changed files with 1 additions and 0 deletions
|
|
@ -192,6 +192,7 @@ function padNumber(num, digits, trim) {
|
|||
|
||||
|
||||
function dateGetter(name, size, offset, trim) {
|
||||
offset = offset || 0;
|
||||
return function(date) {
|
||||
var value = date['get' + name]();
|
||||
if (offset > 0 || value > -offset)
|
||||
|
|
|
|||
Loading…
Reference in a new issue