views:

74

answers:

1

Hi,

I'm trying to setup a custom date parser but can't get my head around it. Basically my dates are in the format mm/yyyy.

Can anyone point me in the right direction?

Thanks

+2  A: 
     $.tablesorter.addParser({ 
         id: 'date_ger', 
         is: function(s) { 
             return false; 
         }, 
         format: function(s) { 
             var res = s.split('/');
             return res[1]+res[0];
         },
         type: 'numeric' 
     });

And use it like this for the third column:

  $(document).ready(function() {
   $("#tableinfi").tablesorter({ 
             headers: {
                 2: {
                  sorter:'date_ger',
                 }
             } 
         });
powtac