Page MenuHomePhabricator

time formatting issues with some precisions
Closed, ResolvedPublic

Description

https://test.wikidata.org/wiki/Q22

When entering "1 January 23" as a date and setting precision to century or less formatting seems to be broken. "+00000000023-01-01T00:00:00Z" is shown instead.


Version: master
Severity: major
Whiteboard: u=dev c=backend p=0

Details

Reference
bz67604

Event Timeline

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

That's actually a feature I recently introduced.

Formatting the year 123 as a century results in "1. century". That's a bit odd (you loose a lot of information) but kind of ok.

But what do you expect from the year 23? "0. century"? "0 million years ago"? I think this needs a fallback. My current fallback is to show the internal format. Other possible fallbacks:

  • Show "0 million years ago" and so on.
  • Show "0" with nothing attached.
  • Show an error message.
  • Show the year as it is (basically fall back to "year" precision").

Please decide. I suggest the last one.

(In reply to Thiemo Mättig from comment #1)

Formatting the year 123 as a century results in "1. century". That's a bit
odd (you loose a lot of information) but kind of ok.

Surely that's the second century, not first, unless you're talking about time deltas and not dates? (I don't know the context, seen this scroll by on IRC.)

(In reply to Bartosz Dziewoński from comment #2)

that's the second century

Correct. We just realized that's an other bug in the current implementation. The "2. century" can also be expressed as "1 century A.D.". And it depends on the language what you need for what precision. We usually say "1 million years" and not "2. age", but this may be different in other languages. So all these messages need two placeholders or what?

Not mentioning the 1990s. Is "199 decades A.D." the same as "1990s" and is that the same as "199. decade A.D."?

Oh wow, language support is fun.

  • Bug 71289 has been marked as a duplicate of this bug. ***

Change 166622 had a related patch set uploaded by Thiemo Mättig (WMDE):
Display full year if precision is to high

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

  • Bug 71956 has been marked as a duplicate of this bug. ***

Change 166622 merged by jenkins-bot:
Display full year if precision is to high

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

Seems like it has been forgotten to set the ticket to "fixed" (at the end, it is just high/major anyway... ;) ). Since the change has been merged, I just verified its behaviour--no ISO string returned anymore.

  • Bug 71289 has been marked as a duplicate of this bug. ***