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

Whitespace breaks date sorting in Firefox #188

Open
markhobson opened this issue May 7, 2020 · 2 comments
Open

Whitespace breaks date sorting in Firefox #188

markhobson opened this issue May 7, 2020 · 2 comments

Comments

@markhobson
Copy link

Whitespace around dates breaks sorting in Firefox, but is fine under Chrome:

https://jsfiddle.net/markhobson/4qmhgzwe/6/

A cursory glance indicates that new Date(date) in tablesort.date.js is not cross-browser compatible:

Firefox:

> new Date(' 2000-01-02 ');
< Invalid Date

Chrome:

> new Date(' 2000-01-02 ');
< Sun Jan 02 2000 00:00:00 GMT+0000 (Greenwich Mean Time) {}
@markhobson markhobson changed the title Date sorting broken in Firefox Whitespace breaks date sorting in Firefox May 8, 2020
@moseslecce
Copy link

I would think the responsibility of the data to be appropriately formatted is outside of the scope of the sorting library. Should the library really sanitize all of the inputs?

@tristen
Copy link
Owner

tristen commented Jun 29, 2020

Should the library really sanitize all of the inputs

Agree. Pull request happily accepted.

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

No branches or pull requests

3 participants