Last modified: 2014-06-13 19:22:46 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 T63701, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61701 - Parse <time> element in DateTimeOriginal
Parse <time> element in DateTimeOriginal
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
CommonsMetadata (Other open bugs)
unspecified
All All
: Unprioritized minor (vote)
: ---
Assigned To: Francis Perron
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-20 20:03 UTC by Tisza Gergő
Modified: 2014-06-13 19:22 UTC (History)
6 users (show)

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


Attachments

Description Tisza Gergő 2014-02-20 20:03:18 UTC
DateTimeOriginal (which comes from the |date= field of the information template) somtimes looks like <time datetime="2000-03-15">2000. március 15.</time>. The visible text part might be the wrong language, or a hard-to-parse format; we should just discard it and use the datetime value.
Comment 1 Francis Perron 2014-06-13 09:38:35 UTC
Looking into this..
Comment 2 Francis Perron 2014-06-13 12:49:47 UTC
Hi Tisza,
  isn't the date output based on your user preferences' language setting? You mean that we should drop the custom output in favor of the verbatim datetime value, in your example:
<time datetime="2000-03-15">2000-03-15</time>?

Or I am not interpreting your suggestion right?


Thanks!
Comment 3 Tisza Gergő 2014-06-13 19:22:46 UTC
Hi Francis,

the date is (usually) parsed from the HTML output generated by [[commons:Template:Information]], which calls [[commons:Template:ISOdate]], which eventually calls {{#time}} to format the date per user language preference. {{#time}} will use the content language of the wiki (English), not the user language, as far as I am aware.

Even if it would be in the correct language, consumers of the API might want to do other things with the date than just display it, so a machine-readable format (simply "2000-03-15" in the example) is preferable IMO.

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


Navigation
Links