Page MenuHomePhabricator

'in 7 hours' timestamp is displayed on articles with just started translation
Closed, ResolvedPublic

Description

  1. Start a new translation - click on a paragraph and then leave the article. The started translation will be saved in 'In progress' tab.
  1. Click on 'All translations' - the started translation will be displayed with the timestamp indicating 'in 7 hours'.

Screen Shot 2017-04-04 at 4.09.03 PM.png (428×865 px, 54 KB)

3, Changing Preferences-Appearance -Time offset does not affect the translation timestamp.

Note: updates on articles or notifications provide relative time - 2 hours ago, 3,min ago. That relative timestamp is calculated against user local time.

Event Timeline

Seeing the same on Special:ContentTranslation after I followed a grey interwiki link for "espagnol" on English Wikipedia:

Screen Shot 2018-03-14 at 00.13.53.png (1×1 px, 480 KB)

For what its worth, both my enwiki and eswiki account use UTC as timezone in Preferences/Appearances, and both wikis also have UTC as default timezone. But I was viewing this on a browser with GMT-0700 (PDT) as operating system timezone.

That seems to be a timezone issue then. Have to see if this can be fixed client side, e.g. https://momentjs.com/docs/#/parsing/utc/

moment( translation.lastUpdateTimestamp, 'YYYYMMDDHHmmss Z' ).fromNow()

But input is like 20171116080713.

Should likely be moment.utc( translation.lastUpdateTimestamp, 'YYYYMMDDHHmmss' ).local().fromNow()

Here is another example of fresh in-progress translation showing wrong timestamp. Seems like confirmation that problem lies in timezone calculations, cause I was in CEST (UTC+2) when this happened.

wrong-time-cx-in-progress.PNG (203×1 px, 29 KB)

Arrbee renamed this task from 'in 7 hours' timestamp is displayed on articles with just started translation to [to triage] 'in 7 hours' timestamp is displayed on articles with just started translation.Jul 6 2018, 5:04 PM
Arrbee moved this task from Bugs to Check & Move on the ContentTranslation board.
Pginer-WMF moved this task from Check & Move to Bugs on the ContentTranslation board.
Petar.petkovic renamed this task from [to triage] 'in 7 hours' timestamp is displayed on articles with just started translation to 'in 7 hours' timestamp is displayed on articles with just started translation.Jul 10 2018, 11:51 PM

Change 445043 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Fix "last update" timestamp for translations

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

Petar.petkovic moved this task from Backlog to Doing on the good first task board.

moment( translation.lastUpdateTimestamp, 'YYYYMMDDHHmmss Z' ).fromNow()

But input is like 20171116080713.

Should likely be moment.utc( translation.lastUpdateTimestamp, 'YYYYMMDDHHmmss' ).local().fromNow()

Submitted patch with this change. Credit to @Nikerabbit.

Change 445043 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix "last update" timestamp for translations

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