Page MenuHomePhabricator

Allow to add new regex to wikibits ts_resortTable (sortable table)
Closed, ResolvedPublic

Description

The way to sort existing formats like dats can be customized by overriding the function with a locale aware one (see bug 15408). However, it doesn't allow to use other formats, like full months. There should be a way to provide new regex to call sortable functions (bug 8226 also wants to increase the recognised date formats, but doesn't allow local customization).


Version: 1.16.x
Severity: normal

Details

Reference
bz20418

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:48 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz20418.
bzimport added a subscriber: Unknown Object (MLST).

r86088

Use it like
tablesorter.addParser( {

		id: "time",
		is: function (s) {
			return ts.rgx.time[0].test(s);
		},
		format: function (s) {
			return $.tablesorter.formatFloat( new Date( "2000/01/01 " + s ).getTime() );
		},
		type: "numeric"

} );