Last modified: 2014-11-17 10:35:38 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 T10226, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8226 - Sortable table date sorting
Sortable table date sorting
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 15401 (view as bug list)
Depends on:
Blocks: javascript
  Show dependency treegraph
 
Reported: 2006-12-12 15:13 UTC by rmhermen
Modified: 2014-11-17 10:35 UTC (History)
10 users (show)

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


Attachments
Patch for wikibits.js to support sorting more date formats (6.32 KB, patch)
2008-01-31 15:22 UTC, Christian Neubauer
Details
Patch for wikibits.js to support sorting more date formats (7.23 KB, patch)
2008-01-31 16:27 UTC, Christian Neubauer
Details

Description rmhermen 2006-12-12 15:13:53 UTC
This is known but I don't see it listed as a bug needing fixing. The new sortable table 
will sort dates but only if the dates are in the uncommon YYYY-MM-DD format and the 
user's preference is also set to display dates that date format.

This should be made sortable for any of the supported date formats and for any 
combination of supported date input formats and display formats.

http://meta.wikimedia.org/wiki/Help:Sorting#Dates discusses issue with a hack to get 
around it.
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-06-20 22:04:39 UTC
*** Bug 10322 has been marked as a duplicate of this bug. ***
Comment 2 Christian Neubauer 2008-01-31 15:22:54 UTC
Created attachment 4601 [details]
Patch for wikibits.js to support sorting more date formats

Here's a patch against HEAD (r30348).  Adds support for the four types of dates shown in preferences.  Also makes a couple other changes.  Tested in IE6/FF2 with this test data:

{|class="wikitable sortable"
|-
!Date sort
|-
|07 Apr 2007
|-
|16 Apr 2007
|-
|01 01 2007
|-
|02-01-2007
|-
|02-02-07
|-
|02-02-97
|-
|02-02-2007
|-
|03:01, July 07, 2008
|-
|03:01, 06 July 2008
|-
|03:01, 05 March 2008
|-
|02:59, 2008 February 05
|-
|02:59, 2007 February 05
|-
|02:59, 2008 March 05
|-
|2008-01-01T10:59:59
|-
|2007-01-01T11:00:00
|-
|2007-01-01T11:59:59
|-
|2007-01-01T10:59:59
|}
Comment 3 Niklas Laxström 2008-01-31 15:26:42 UTC
And what if the language is not English?
Comment 4 Christian Neubauer 2008-01-31 15:42:56 UTC
suffer
Comment 5 Christian Neubauer 2008-01-31 16:27:33 UTC
Created attachment 4602 [details]
Patch for wikibits.js to support sorting more date formats

Okay, I added support for other languages.

I added a global JavaScript variable called ts_month_map.  In your wiki, you can do something like ts_month_map["Word for Jan in some other language"] = "01"; in your site-wide JavaScript.  It doesn't work on multilingual wikis like commons.

I also added support for some other date formats.  It should support 

* DD-[Jan|January]-YYYY
* YYYY-[Jan|January]-DD
* YYYY, DD [Jan|January]
* [Jan|January] DD, YYYY
* YYYY-MM-DD
* MM-DD-YYYY
* MM-DD-YY
* hh:ss, January DD, YYYY
* hh:ss, DD January YYYY
* hh:ss, YYYY January DD
* YYYY-MM-DDTHH:mm:ss
Comment 6 Jonathan 2008-10-05 00:12:16 UTC
1. Can I apply this patch to the js file which came with mediawiki 1.13.2?

2. (Sorry but) how can I apply the patch & do you have a full file so I can just swap them?

Many thanks ~~~~
Comment 7 bluehairedlawyer 2009-02-03 10:18:36 UTC
I'm not sure if we should really support all of these date/time formats. I certainly like to argue that we definitely shouldn't support numeric formats such as 

31.12.2008
12.31.2008

or worse

31.12.67

The only place people use 12.31.2008 is in the US and on enwiki we use both US and European formats. Using these ambiguous date should be strongly discourages and certainly not supported by the sorting script.

Supporting 31.12.67 should be punishable by summary execution!! Same problems as before and y2k bug anyone! Not to mention the y2050 bug. For an encyclopedia which tries to have articles written with historical perspective 31.12.67 or 12.31.67 should be a definite no no.

Sometimes less is more. We should just focus on 4 formats commonly used on enwiki:

1 January 2009
January 1, 2009 (with and without the comma)
1 Jan 2009 (also 01-Jan-2009)
2009-01-01

and leave the rest out to wither and die.
Comment 8 bluehairedlawyer 2009-02-03 10:33:16 UTC
On second thoughts I guess 01.12.2008 could be quite safely used outside enwiki.
Comment 9 bluehairedlawyer 2009-02-03 10:34:16 UTC
*** Bug 15401 has been marked as a duplicate of this bug. ***
Comment 10 Platonides 2009-08-27 12:28:38 UTC
Related bug 15408 and bug 20418.
Comment 11 yonidebest 2010-12-18 13:21:42 UTC
Please also add sorting support for dating in Hebrew for the Hebrew Wikipedia (and perhaps the Yiddish and Arabic ones). Our dates are written "j בF Y". Note the "ב" character before the month. With wikilinks: "[[j בF]] [[Y]]".
Comment 12 DieBuche 2011-04-15 08:42:45 UTC
Fixed r86088
It pulls the translated month names and abbr. from the messages, and tries to match them in strings

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


Navigation
Links