We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
While using the script for my site I saw that the following dates are not sorted in the right order: 18.02.2018
11.02.2018 16.01.2018 18.02.2018
Is there a fix for this? Using 'uk' as a parameter didn't work.
'uk'
Regards Andi
The text was updated successfully, but these errors were encountered:
The built-in "shortDate" parser only works with these formats dd-mm-yyyy or dd/mm/yyyy, not dd.mm.yyyy.
dd-mm-yyyy
dd/mm/yyyy
dd.mm.yyyy
You can add your own custom date parser like this (demo):
$(function() { $.tablesorter.addParser({ id: "ddmmyyyy", is: function(s) { return /\d{1,2}[\.\/\-]\d{1,2}[\.\/\-]\d{2,4}/.test(s); }, format: function(s, table) { var c = table.config, // reformat the string in ISO format d = s.replace(/(\d{1,2})[-.\/](\d{1,2})[-.\/](\d{4})/, "$3/$2/$1"), date = new Date(d); console.log(d, date) return date instanceof Date && isFinite(date) ? date.getTime() : s; }, type: "numeric" }); $('table').tablesorter({ headers: { 2: { sorter: 'ddmmyyyy' } } }); });
Sorry, something went wrong.
No branches or pull requests
Hello,
While using the script for my site I saw that the following dates are not sorted in the right order:
18.02.2018
Is there a fix for this?
Using
'uk'
as a parameter didn't work.Regards
Andi
The text was updated successfully, but these errors were encountered: