From f046f6f73c910998a94f30a4cb4ed087b6325485 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 7 May 2013 11:43:25 +0100 Subject: [PATCH] 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 --- src/ng/filter/filters.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index d4f09581ee1b..3830e965ffec 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)