https://bugzilla.wikimedia.org/show_bug.cgi?id=25768
Markus Krötzsch <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED Severity|critical |normal --- Comment #3 from Markus Krötzsch <[email protected]> 2012-02-11 23:01:57 UTC --- First, this bug is not "critical". Mainly, the issue is a basic limitation of the "recipe" at [1] and this recipe should warn about this. SMW takes special precautions to avoid this problem in its own tables. By using a manually created table, this special handling is eliminated. The sortable table code of MediaWiki cannot handle dates. To make them sort properly, one needs to provide numeric sortkeys using the "data-sort-value" attribute in td elements (look at the HTML of any real SMW table for examples). When manually creating tables, one is in charge of providing this information, or one needs to use JavaScript that can handle dates natively (which is difficult due to the complex format). To allow this to be done manually, I have now (in r111269) added a new output format "sortkey" to Type:Date by which one can obtain a numeric sortkey as needed for "data-sort-value". For example, the following query displays dates and their sortkeys: {{#ask: [[Modification date::+]] | ?Modification date | ?Modification date#sortkey }} For properties that can have many values, only one sortkey must be used (since the whole table row is sorted as one, even if many dates are in one cell). This can be achieved by using +limit like so: {{#ask: [[testdate::+]] | ?testdate | ?testdate#sortkey |+limit=1 }} It would be nice if the recipe could be extended by all this information, and ideally with a recipe for building the correct HTML code. This goes as far as SMW can assist the manual creation of sortable tables, so I am closing this bug. [1] http://smw.referata.com/wiki/Use_the_ask_template_format_to_create_tabular_output -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
