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

Date formatting for ISODate string fails on Android 2.1 stock browser #2275

Closed
thiloplanz opened this issue Apr 2, 2013 · 1 comment
Closed

Comments

@thiloplanz
Copy link

The following does not work on the Android 2.1 stock browser.

<!doctype html>
<html>
  <body ng-app>
    <span>{{ '2013-03-12T06:26:08.832Z' | date }}</span>       
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
  </body>
</html>

It prints "Mar NaN, NaN" instead of "Mar 12, 2013".

Problem occurs with both Angular 1.0.5 and 1.1.3.

thiloplanz added a commit to thiloplanz/angular.js that referenced this issue Apr 2, 2013
if "offset" is not specified, it messes up the calculations that follow. Apparently, it does not default to 0 in arithmetic context on some older browsers.
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue May 7, 2013
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 angular#2277, angular#2275
petebacondarwin added a commit that referenced this issue May 7, 2013
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
@btford btford closed this as completed Aug 24, 2013
@btford
Copy link
Contributor

btford commented Aug 24, 2013

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants