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

Names with numbers being read as date #21

Closed
danielocdh opened this issue Mar 3, 2015 · 1 comment
Closed

Names with numbers being read as date #21

danielocdh opened this issue Mar 3, 2015 · 1 comment

Comments

@danielocdh
Copy link

This probably has to do with how browsers are parsing text from dates, for example on chrome
Date.parse('something 1');
returns the same as
Date.parse(1);

Even if you fix this, maybe it would be nice to have a way to override the column type, so we can override the type of data we want on the columns. An idea, replace "type" declaration on setupClickableTH for this:

    var type, type_override;
    type_override = th.getAttribute('data-sort_type');
    if (type_override && sortable.types.hasOwnProperty(type_override)) {
      type = sortable.types[type_override];
    } else {
      type = sortable.getColumnType(table, i);
    }
adamschwartz added a commit that referenced this issue Sep 16, 2015
- better handling of touch events (#23, #18)
- allow type to be overridden with `data-` and allow custom types to be set up via `sortable.setupTypes`, uses cleaner compare fns (#21, #17, #16)
- add `CustomEvent` when sorting finishes (#25)
- amd/commonjs (#10)
- stable sort (#14)
- performance improvements when reversing

thx for the help @zackbloom
@adamschwartz
Copy link
Contributor

Thanks @danielocdh. We elected to go the route of allowing both types to be customized and specified directly by a data- attribute on the th. Hopefully this should solve your issue as well as the many other issues people have had with types. An update to the docs will be coming shortly, but in the meantime, please check out cab1613 for more information. Thanks again!

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