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

Commit

Permalink
fix(dateFilter): correctly format ISODates on Android<=2.1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petebacondarwin committed May 7, 2013
1 parent 52c1498 commit f046f6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ng/filter/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f046f6f

Please sign in to comment.