Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f046f6f

Browse files
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
1 parent 52c1498 commit f046f6f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ng/filter/filters.js

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ function padNumber(num, digits, trim) {
192192

193193

194194
function dateGetter(name, size, offset, trim) {
195+
offset = offset || 0;
195196
return function(date) {
196197
var value = date['get' + name]();
197198
if (offset > 0 || value > -offset)

0 commit comments

Comments
 (0)