Parse <time> element in DateTimeOriginal
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: minor

Details

Reference
bz61701
bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz61701.
Tgr created this task.Feb 20 2014, 8:03 PM

francisp wrote:

Looking into this..

francisp wrote:

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!

Tgr added a comment.Jun 13 2014, 7:22 PM

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.

MarkTraceur triaged this task as Low priority.Nov 24 2014, 1:53 PM
MarkTraceur set Security to None.

Change 181978 had a related patch set uploaded (by M4tx):
Parse <time> element in DateTimeOriginal

https://gerrit.wikimedia.org/r/181978

Patch-For-Review

m4tx claimed this task.Dec 28 2014, 3:44 PM

Change 181978 merged by jenkins-bot:
Parse <time> element in DateTimeOriginal

https://gerrit.wikimedia.org/r/181978

Tgr closed this task as Resolved.Dec 28 2014, 8:33 PM