Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderBy incorrect on IE11 #36

Closed
screaney opened this issue Jul 6, 2017 · 1 comment
Closed

OrderBy incorrect on IE11 #36

screaney opened this issue Jul 6, 2017 · 1 comment

Comments

@screaney
Copy link

screaney commented Jul 6, 2017

I found that doing OrderBy() then ThenBy() on IE 11 returns a different result set than on Chrome or Firefox.

Created jsfiddle to reproduce:
https://jsfiddle.net/screaney/gj0gwxfo/4/

It appears on IE the ThenBy places them in reverse instead of asc/asc.

@mihaifm
Copy link
Owner

mihaifm commented Jul 13, 2017

I checked your fiddle, indeed it replicates on IE, however I don't think it's a problem with the library. In your code you are comparing moment.utc objects, I think the difference comes from the way IE handles object comparison internally.
To fix this you should be comparing strings. Looking over the documentation for moment.js, I see that you can call moment.utc(...).format() to get a string representation.

It works for me:
https://jsfiddle.net/Ljef8eks/

@mihaifm mihaifm closed this as completed Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants