Last modified: 2011-04-15 08:49:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22418, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20418 - Allow to add new regex to wikibits ts_resortTable (sortable table)
Allow to add new regex to wikibits ts_resortTable (sortable table)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.16.x
All All
: Low normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-27 12:28 UTC by Platonides
Modified: 2011-04-15 08:49 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Platonides 2009-08-27 12:28:07 UTC
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).
Comment 1 DieBuche 2011-01-08 15:19:06 UTC
fixed in patch for Bug 8028
Comment 2 DieBuche 2011-04-15 08:49:22 UTC
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"
	} );

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links