Page MenuHomePhabricator

Transform date in the author line to user preference date format
Open, LowPublicBUG REPORT

Description

Transform the date in the author line to user preference date format:

"Von username (talk · contribs) · 29 Bearbeitungen seit 2011-11-05"

Expected output:

"Von username (talk · contribs) · 29 Bearbeitungen seit 5. Juni 2011"


Version: master
Severity: trivial
URL: https://en.wikipedia.org/wiki/Special:NewPagesFeed?uselang=de

Details

Reference
bz38079

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:49 AM
bzimport added projects: PageTriage, I18n.
bzimport set Reference to bz38079.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 39379 has been marked as a duplicate of this bug. ***

The problem is this is all being done on the client side, and the API is not aware of the user's date format, or even that there is a user. Perhaps we need to build some date handling functionality into mw.language or mw.util.

First step will be to retrieve the user's date format preference:

mw.user.options.get( 'date' )

This will return one of the following:

  • default
  • mdy
  • dmy
  • ymd
  • ISO 8601

There's also a timecorrection preference that might be needed.

This looks like it's actually going to be rather difficult to fix as the formatting depends on having access to about 1500 formatting strings (5 formats x 300 languages) which currently aren't available on the client side. Siebrand says the i18n team is eventually going to implement a solution for this, but suggests in the meantime we work around the problem by having our API handle the formatting on the server-side. This will require some refactoring in PageTriage so it might be a little while before it gets implemented.

See also Brion on http://lists.wikimedia.org/pipermail/wikitech-l/2012-December/065400.html

I'm not sure if we have full localization for dates in JS...

...but you can use the browser's built-in support. You won't get the same
formatting, and it may not match the user's *time zone preference* in
MediaWiki...

eg
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleString

Aklapper changed the subtype of this task from "Task" to "Bug Report".Feb 5 2022, 2:33 PM

The date is now localised to the user's language, but it does not format based on user preference.