aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-05-07 11:43:25 +0100
committerPete Bacon Darwin2013-05-07 11:44:46 +0100
commit01bda54e05af49d630422a8aece0517237f271f5 (patch)
tree4738628416a7999abf33fea23d8b7496eb4e3674 /src
parentbc04afe1835f9c506b946dcb28a13158ace32a70 (diff)
downloadangular.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.js1
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)