javascript - Tablesorter and date mm/yyyyy -
i've been using tablesorter lot in website this
$(".tablesorter").tablesorter({ widgets: ['zebra'], dateformat: 'uk', }); but i've problem date in format : mm/yyyy (it's when don't have day prefer showing 12/2005 00/12/2005).
this format not work tablesorter dateformat uk. how create working ?
and difficulty can have in same table differents formats :
date - title 11/2005 - film 1 12/11/2005 - film 2 2006 - film 3 thank you.
you add custom parser:
$.tablesorter.addparser({ id: 'rough-date', is: function() { // homecoming false parser not auto detected homecoming false; }, format: function(s) { // format iso 8601 date (2005-11-12). // month-only dates formatted 2005-11. homecoming s.split('/').reverse().join('-'); }, type: 'text' // sort strings }); and utilize (where 0 column number contains date):
$(".tablesorter").tablesorter({ headers: { 0: { sorter:'rough-date' } } }); here's jsfiddle.
javascript tablesorter
No comments:
Post a Comment