Page MenuHomePhabricator

Allow wikitext to output dates that are enhanced with a relative date "time ago"
Open, LowestPublic

Description

Author: sigol

Description:
When hovering over a date in a wiki page, it would be really nice if the software showed how long ago (or how far in the future) the date was.

For example, if I hover over 2 December 1973, it showed something like "39 years, 1 month and 4 days ago".

And if I hover over "2 December 2023", it showed something like "10 years, 10 months and 15 days in the future".

This would help us quickly get an idea of the time that has passed since the event, which helps improve your understanding of a particular piece of history.

Anyways, just my two pennies.


See Also:
T21992: Support client-side date/time formatting for user's timezone, language, and preferred format (JavaScript)

Details

Reference
bz44795

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 1:13 AM
bzimport set Reference to bz44795.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for the idea. It's an interesting one but would collide with web browsers that show the target URL on mouseover, and many such dates are weblinks. So I don't think this is feasible.

sigol wrote:

Hi Andre, thank you for your feedback. I get what your saying. You're right, many dates are hyperlinks. I hadn't thought of that.

What about a small icon next to a date. When you click on (or hover over?) the icon, you get the relative date box.

I think this is an important issue. Many people are a bit date-lexic, in that they struggle to visualize dates in their mind.

I personally have no concept of 1755 for example. If you can quantify it in terms of years ago/years ahead, this would make Wikipedia more inclusive for those of us who find it hard to visualize dates in our mind.

sigol wrote:

Apologies for the terrible grammar with "your saying". I should be shot at dawn.

Currently there are no plans to provide this idea in the MediaWiki code, as your idea might only be useful for a small amount of users. However it could always become an extension which could be provided by third party developers!
See http://www.mediawiki.org/wiki/Manual:Developing_extensions for more info.

In fact MediaWiki core doesn't know when a text string is a date. Wikipedia uses a template for this: http://en.wikipedia.org/wiki/Template:Date

Maybe the functionality you are requesting could be build on / around that template? The discussion should happen in that page. And this sounds like a WONTFIX here.

I just found a gadget (enabled at least in English Wikipedia) that does basically what you say, but only for dates in comments:

http://en.wikipedia.org/wiki/Wikipedia:Comments_in_Local_Time

And againas a coincidence I learned about the {{#time}} parser function: https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time

MatmaRex, Krinkle, would you mind sharing your thoughts about this request.

My agenda here: seeing whether this could be a potential Google Code-in task

https://www.mediawiki.org/wiki/Google_Code-In

Also, is there a better component for this report?

Thank you.

Per previous comments, this is rather impossible to do in general, but we could do that for e.g. dates of edits on contributions pages, dates on history pages, in logs etc. I have no particular opinion on whether this is a good idea, I suppose it can't hurt. Alas, I have no idea how hard/easy it could be, hopefully these dates are all generated in just one place in the code.

Krinkle renamed this task from On Mouse over on dates, show relative time period to date to Allow wikitext to output dates that are enhanced with a relative date "time ago".Apr 12 2020, 10:55 PM
Krinkle edited projects, added MediaWiki-Parser; removed OKR-Work.
Krinkle updated the task description. (Show Details)

Tagging Parser as it might require something there to allow the loading of the client-side module discussed in T21992.

However it does not need to have any kind of grammer per-se, it could be as simple as a class name or data attribute triggering the feature.