diff options
| author | Pete Bacon Darwin | 2013-05-07 11:43:25 +0100 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-07 11:44:46 +0100 |
| commit | 01bda54e05af49d630422a8aece0517237f271f5 (patch) | |
| tree | 4738628416a7999abf33fea23d8b7496eb4e3674 /src | |
| parent | bc04afe1835f9c506b946dcb28a13158ace32a70 (diff) | |
| download | angular.js-01bda54e05af49d630422a8aece0517237f271f5.tar.bz2 | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/filter/filters.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index 3b96fe1a..5bc29b7e 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -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) |
