Last modified: 2014-05-16 13:21:55 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 T66659, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64659 - Failure to format dates with timestamp that have 00 for month and/or day
Failure to format dates with timestamp that have 00 for month and/or day
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-30 15:32 UTC by Aude
Modified: 2014-05-16 13:21 UTC (History)
2 users (show)

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


Attachments

Description Aude 2014-04-30 15:32:19 UTC
TimeValues that have timestamps such as '+00000001995-00-00T00:00:00Z' with '00' for month and/or day gets converted to '1995-00-00T00:00:00Z' then is passed through MWTimestamp( $timestamp ), which in turn does new DateTime( $timestamp ) for TS_UNIX.

new DateTime( '1995-00-00T00:00:00Z' ) results in an object with date value of '1994-11-30 00:00:00'.

MwIsoTimestampFormatter then considers the year invalid since original '1995' != '1994' and on failure, does fallback to outputting a timestamp.

Example of an item where this occurs on Wikidata is https://www.wikidata.org/wiki/Q4119465
Comment 1 Aude 2014-04-30 15:32:49 UTC
this is when the TimeValue has PRECISION_YEAR
Comment 2 Aude 2014-04-30 15:54:20 UTC
btw, the iso regex pattern for validation is '!^[-+]\d{1,16}-(0\d|1[012])-([012]\d|3[01])T00:00:00Z$!' so 00 for month and/or day is considered valid.
Comment 3 Gerrit Notification Bot 2014-04-30 15:57:17 UTC
Change 130617 had a related patch set uploaded by Aude:
Fix formatting of TimeValues with month or day = '00' in timestamp

https://gerrit.wikimedia.org/r/130617
Comment 4 Gerrit Notification Bot 2014-04-30 17:29:26 UTC
Change 130617 merged by jenkins-bot:
Fix formatting of TimeValues with month or day = '00' in timestamp

https://gerrit.wikimedia.org/r/130617
Comment 5 Gerrit Notification Bot 2014-05-01 13:37:51 UTC
Change 130827 had a related patch set uploaded by Aude:
Fix formatting of TimeValues with month or day = '00' in timestamp

https://gerrit.wikimedia.org/r/130827
Comment 6 Gerrit Notification Bot 2014-05-01 13:43:49 UTC
Change 130827 merged by jenkins-bot:
Fix formatting of TimeValues with month or day = '00' in timestamp

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

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


Navigation
Links