mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-28 15:28:15 +00:00
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
This commit is contained in:
parent
bc04afe183
commit
01bda54e05
1 changed files with 1 additions and 0 deletions
|
|
@ -192,6 +192,7 @@ function padNumber(num, digits, trim) {
|
||||||
|
|
||||||
|
|
||||||
function dateGetter(name, size, offset, trim) {
|
function dateGetter(name, size, offset, trim) {
|
||||||
|
offset = offset || 0;
|
||||||
return function(date) {
|
return function(date) {
|
||||||
var value = date['get' + name]();
|
var value = date['get' + name]();
|
||||||
if (offset > 0 || value > -offset)
|
if (offset > 0 || value > -offset)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue