Page MenuHomePhabricator

Wrong century rounding is applied when entering Time values
Closed, ResolvedPublic

Description

When the intention is to enter a century, one has to enter a year and then switch the precision via the advanced options. However, entering a year belonging to the first half of a century, will actually detect the previous (wrong) century, for example:
Specifying a year between 1201 to 1249 will be detected as 12th century (though it should be 13th century) while all years from 1250 to 1349 are detected as 13th century. Inappropriate rounding seems to be applied.


Version: unspecified
Severity: critical
Whiteboard: u=dev c=frontend p=8 s=2014-09-23

Details

Reference
bz64742

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:25 AM
bzimport set Reference to bz64742.
bzimport added a subscriber: Unknown Object (MLST).

The bug might be located in lib/includes/formatters/MwTimeIsoFormatter.php
One could probably resolve it by replacing lines 211/212 by something like:
$fullYear = ceil( $fullYear/100 );

Change 162242 had a related patch set uploaded by Daniel Kinzler:
Fix counting of centuries and millennia.

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

Change 162242 merged by jenkins-bot:
Fix counting of centuries and millennia.

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