Page MenuHomePhabricator

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

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:57 AM
bzimport set Reference to bz61701.

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!

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 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

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

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