[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread aquaone
Yes but it may be better to change your separator.

I haven't tested this but it should work...

$.tablesorter.addParser({
  id: dotDate,
  is: function(s) {
return /\d{1,2}\.\d{1,2}\.\d{2,4}/.test(s);
  },
  format: function(s,table) {
s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, $1/$2/$3);
return $.tablesorter.formatFloat(new Date(s).getTime());
  },
  type: numeric
});

stephen


On Wed, Nov 5, 2008 at 11:53, Josip Lazic [EMAIL PROTECTED] wrote:


 Is it possible to sort column with dates in dd.mm. format?




[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread aquaone
ack, just realized you're doing dd.mm so gotta change it to
s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, $2/$1/$3);
i think?

stephen

On Wed, Nov 5, 2008 at 13:50, aquaone [EMAIL PROTECTED] wrote:

 Yes but it may be better to change your separator.

 I haven't tested this but it should work...

 $.tablesorter.addParser({
   id: dotDate,
   is: function(s) {
 return /\d{1,2}\.\d{1,2}\.\d{2,4}/.test(s);
   },
   format: function(s,table) {
 s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, $1/$2/$3);
 return $.tablesorter.formatFloat(new Date(s).getTime());
   },
   type: numeric
 });

 stephen



 On Wed, Nov 5, 2008 at 11:53, Josip Lazic [EMAIL PROTECTED] wrote:


 Is it possible to sort column with dates in dd.mm. format?





[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread MorningZ

Posted this code:
http://paste.pocoo.org/show/86103/

on an earlier exact post like this:

$.tablesorter.addParser({
id: 'dd.mm.',
is: function(s) {
return false;
},
format: function(s) {
s = '' + s; //Make sure it's a string
var hit = s.match(/(\d{1,2})\.(\d{1,2})\.(\d{4})/);
if (hit  hit.length == 4) {
return hit[3] + hit[2] + hit[1];
}
else {
return s;
}
},
type: 'text'
});




and don't forget, you have to wire up the custom sorter in the options
of the .tablesorter() wire up








On Nov 5, 2:53 pm, Josip Lazic [EMAIL PROTECTED] wrote:
 Is it possible to sort column with dates in dd.mm. format?


[jQuery] Re: tableSorter - sorting

2007-07-07 Thread Christian Bach

Hi Phil,

In the 1.x release there is a option called disableHeader

Here is a example:

// disable one header from being sorted
disableHeader: 0

//disable more then one
disableHeader: [0,5,8]

/christian

2007/7/5, Phil Glatz [EMAIL PROTECTED]:



Christian Bach wrote:
 And to leak a new feature: it will contain multiple column sorting.

One more suggestion, if it isn't in there already: the ability to
exclude some columns as sortable. The column wouldn't display the
sorting class in the header, and clicking on it would have no effect.
Maybe a list (array) of  column names to use as sortable, or excluded
from sorting.





--
POLYESTER*
Wittstocksgatan 2
115 24 Stockholm
Phone: 08-660 73 50 / +46-8-660 73 50
Mobile: 070-443 91 90 / +46-70-443 91 90
E-mail: [EMAIL PROTECTED]
http://www.polyester.se


[jQuery] Re: tableSorter - sorting

2007-07-05 Thread Phil Glatz

Christian Bach wrote:
 And to leak a new feature: it will contain multiple column sorting.

One more suggestion, if it isn't in there already: the ability to
exclude some columns as sortable. The column wouldn't display the
sorting class in the header, and clicking on it would have no effect.
Maybe a list (array) of  column names to use as sortable, or excluded
from sorting.