-
Notifications
You must be signed in to change notification settings - Fork 27.5k
[bug fix] Date formatting for ISODate string fails on Android 2.1 stock browser, #2275 #2277
Conversation
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.
|
Hi Thilo, thanks for the pull request! Could you add unit tests to this PR as well as fixing the commit message format. |
I am going to need some pointers for the unit test. The existing tests do not break with this patch (at least not for Safari on OS X), and presumably they cover this feature (will verify that later). What we probably want here is a test case that demonstrates the problem on Android 2.1 before this patch was applied (and how the patch fixes it). Unfortunately, I have no idea how to run tests for/on Android. Maybe using the SDK simulator? |
@thiloplanz - If you can get the emulator running on your machine then just point its browser at http://localhost:9876/ when running the unit tests. |
I can confirm that our current filterSpec.js tests fail on this issue for Android 2.1 (emulated) and that they pass with the patch in place. |
I suggest an simpler fix though:
|
Thank you, Pete, for confirming test coverage. So, how do I go about fixing the commit message? Close this pull request, rebase on top of current master (with the simpler fix), and make a fresh pull request? |
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
Reimplemented and merged at : f046f6f. |
@thiloplanz - the best way is to either rebase or amend the commit and force a push. That way we keep all the comments in one PR. |
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.