Sortable table date sorting
Closed, ResolvedPublic

Description

Author: rmhermen

Description:
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.


Version: unspecified
Severity: normal

bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz8226.
bzimport created this task.Via LegacyDec 12 2006, 3:13 PM
bzimport added a comment.Via ConduitJun 20 2007, 10:04 PM

ayg wrote:

*** Bug 10322 has been marked as a duplicate of this bug. ***

cneubauer added a comment.Via ConduitJan 31 2008, 3:22 PM

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
}

attachment wikibits.js.diff ignored as obsolete

Nikerabbit added a comment.Via ConduitJan 31 2008, 3:26 PM

And what if the language is not English?

cneubauer added a comment.Via ConduitJan 31 2008, 3:42 PM

suffer

cneubauer added a comment.Via ConduitJan 31 2008, 4:27 PM

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

Attached: wikibits.js.diff

bzimport added a comment.Via ConduitOct 5 2008, 12:12 AM

jon.1234 wrote:

  1. Can I apply this patch to the js file which came with mediawiki 1.13.2?
  1. (Sorry but) how can I apply the patch & do you have a full file so I can just swap them?

Many thanks ~~~~

bzimport added a comment.Via ConduitFeb 3 2009, 10:18 AM

bluehairedlawyer wrote:

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.

bzimport added a comment.Via ConduitFeb 3 2009, 10:33 AM

bluehairedlawyer wrote:

On second thoughts I guess 01.12.2008 could be quite safely used outside enwiki.

bzimport added a comment.Via ConduitFeb 3 2009, 10:34 AM

bluehairedlawyer wrote:

*** Bug 15401 has been marked as a duplicate of this bug. ***

Platonides added a comment.Via ConduitAug 27 2009, 12:28 PM

Related bug 15408 and bug 20418.

bzimport added a comment.Via ConduitDec 18 2010, 1:21 PM

yonidebest wrote:

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]]".

DieBuche added a comment.Via ConduitApr 15 2011, 8:42 AM

Fixed r86088
It pulls the translated month names and abbr. from the messages, and tries to match them in strings

matmarex added a project: JavaScript.Via WebDec 21 2014, 7:06 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.