Relative dates

Nao

  • Dadman with a boy
  • Posts: 16,079
Relative dates
« on November 10th, 2013, 12:42 PM »
Talking with Pandos reminded me that I needed to open a topic about this.

So, a few weeks ago, I wrote a quick, rough implementation of relative dates for Wedge. They behave like in Facebook or other 'modern' software, or, closer to us, ElkArte. I wanted pages to validate, and still use valid semantic tags, so I adopted the time tag, and used DATE_W3C as the datetime format, it's longer but more 'solid', and takes timezones into account.

At that point, I had: <time datetime="w3c valid date">Absolute date</time>
Okay.

I used JS to transform absolute dates to relative dates, and it's pretty neat and tidy. I'm happy with it.
But JS has this tiny little problem: it doesn't execute immediately (whatever you may think), and as such, the browser first shows the page with absolute dates, then executes the JS, and replaces dates with relative dates.
The problem is that I didn't realize this because I usually do page reloads, and Chrome is smart enough to execute the JS ASAP and thus I never see the absolute dates. However, if I simply move to a new page, I can see the absolute dates for a split second. I don't like that.

The solution would be to then use relative dates right in the HTML, but what if I want to know the exact date a message was posted at..? I'll have to keep it in a title tag (when right now, the title tag is generated on the fly from the contents of the time tag. Smart enough.) So, that makes this kind of line: <time datetime="w3c valid date" title="Absolute date">Relative date</time>

And, believe me, I think it's wayyyy overkill just for providing an accessible way of getting a relative date. I was already unsure about committing my HTML/JS work with the first version, but this one... Well, it's just not cool.
Not only that, but what if the user likes absolute dates better? Oh, well, I guess I can then simply change the HTML I'm printing out, I guess... I can wrap it up inside a small helper function, provide it a timestamp and then expect Wedge to do all the work for me. Okay, I'm okay with that. I can do that. The only thing I'm not looking forward to, is adding the UI for it, even if it's simple, because I'm rather remove user options than add them, but well, I think it's something that polarizes users more than "number of topics per page", I'd say.

But the extra length of time tags, I'm not sure it's worth it... :-/

So, two questions... Do you like absolute or relative dates better, and do you think it's all worth implementing (considering if I do, I'll add a setting to let you choose your preference)?
Also, when it comes to relative dates, how far away (ago?) do you think it's worth reverting back to absolute dates? I'm not exactly the kind of guy who enjoys seeing a "6 years ago" date. I prefer to see "May 2007", but maybe that's just me. I also don't like seeing "3 months ago" either, but I'm fine with "5 days ago", so... I guess it's a fair question.

PS: oh, another one... I also think it'd be really cool to see "5 days ago at 8:54" rather than just "5 days ago". Oddly, I've never seen this kind of implementation, anywhere...

Wanchope

  • Posts: 234
Re: Relative dates
« Reply #1, on November 10th, 2013, 02:03 PM »
I always like relative time though I agree it can be confusing. The best I've seen so far is that of Facebook. Something like
5 Seconds ago
5 Minutes ago
5 Hours ago
Yesterday @ 9 PM
Nov. 8 @ 9 PM

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Relative dates
« Reply #2, on November 10th, 2013, 03:14 PM »
I didn't remember Facebook did hours on older dates. Maybe it's a recent change. I never spend more than a few minutes a week on Facebook, these days. More time to work.

MultiformeIngegno

  • Posts: 1,337
Re: Relative dates
« Reply #3, on November 10th, 2013, 06:10 PM »
I don't think the extra length of time tags is such a big problem :)
I like relative dates for today and yesterday, then "normal" dates.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Relative dates
« Reply #4, on November 12th, 2013, 11:36 AM »
Let's say it's 6am.
A message posted at 3am: "3 hours ago". Okay.
A message posted at 11pm the previous day: should it say "7 hours ago", or "yesterday at 11pm"?
A message posted at 11pm 2 days ago: should it say "2 days ago at 11pm", or "day/month at 11pm"? If "2 days ago", does it mean "yesterday" is an exception?

I've looked a bit at how Facebook does it, and apparently they have a 24-hour window where they'll say "x hours ago", then after that, it uses the Wedge system: they'll say "yesterday" if it's the day before (e.g. right now it's 11:30am for me, so any posts sent between 0:00 and 11:30 yesterday will be marked a 'yesterday xx:xx'), anything beyond yesterday is given a proper date (november 10..), and anything before 2013 also adds the year, like in Wedge. (I can't believe SMF and even Elk (in its title param) still show the current year.)

So, basically, their relative dates are really simple, they're only for the last 24 hours...
Should I do it like them, and drop the idea of extending relative dates to months or even years..?
Or should I go the extra mile, but stop midway, say at x days or weeks, and after that, revert to absolute dates?

Sara

  • Walking Contradiction
  • Posts: 41
Re: Relative dates
« Reply #5, on November 12th, 2013, 12:24 PM »
Quote
Should I do it like them, and drop the idea of extending relative dates to months or even years..?
Short answer: Yes.

Slightly longer answer: Relative dates start to get a little confusing (at least for me) when it extends beyond the here and now of Today and Yesterday.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Relative dates
« Reply #6, on November 12th, 2013, 01:16 PM »
Yep.
But it can also be said that "3 months ago" is easier to get than "August 3" when you're just a bit out of sync with what date it is right now... (Like, "I'm busy working on Wedge. Do you want to do it for me? No? Then keep telling me what day it is and shut up!")
:P

Sara

  • Walking Contradiction
  • Posts: 41
Re: Relative dates
« Reply #7, on November 12th, 2013, 01:27 PM »
True, but then if you're going to be thorough with it then you'd have to do something like "5 days ago"...at least go up to months with relativeness?  So perhaps you can do "2 weeks ago" instead of "14 days ago"...as long as you consolidate with specific measurements of time.

Hristo

  • Posts: 19
Re: Relative dates
« Reply #8, on December 2nd, 2013, 03:28 PM »
Once I installed SMF's relative dates mod, but it didn't took much time before I uninstalled it. I find the absolute dates more practical. Often I want to know what was the exact time gap between 2 (or more) posts and seeing "today", "yesterday", "x days ago" etc. annoyed me.

I would prefer on my forum the absolute dated to be visible and the relative dates for the tooltips. Also the delayed switch is a big no, no for me.

That was just my preferences of course.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Relative dates
« Reply #9, on December 2nd, 2013, 11:07 PM »
I've gotten used to the whole thing, I'll admit. If I want more specific times, it's always available on mouse-over.

Maybe I should add a user option, though...

MultiformeIngegno

  • Posts: 1,337
Re: Relative dates
« Reply #10, on December 3rd, 2013, 07:53 PM »
BTW in the tooltip appears the strong tag.

Drunken Clam

  • Drool, drool, drool....!
  • Posts: 154
Re: Relative dates
« Reply #11, on December 3rd, 2013, 08:02 PM »
Quote from MultiformeIngegno on December 3rd, 2013, 07:53 PM
BTW in the tooltip appears the strong tag.
.... but only for posts that include hours/minutes...(but then again......maybe not!)

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Relative dates
« Reply #12, on December 3rd, 2013, 08:09 PM »
Ah, indeed! Thank you for the heads-up. Fixed. (Takes no extra JS bytes, yeehee.)