This is a feature request for distance-defined dates. The idea is that certain elements of a timestamp are more or less relevant for something that occurred recently or a long time ago.

For example, something that happened an hour ago would be (as time went on):
1 hour ago
22 hours ago (up to 23 hours)
Yesterday at 7:02pm (up to 2 days)
Wednesday at 7:02pm (up to 1-2 weeks)
Wednesday, November 24 (up to 6 months)
November 24, 2010

This isn't an original idea -- I've seen it at a few places -- but I think it would be a small usability improvement.

CommentFileSizeAuthor
#8 test (Content) | Date Test Site.jpg54.32 KBkarens

Comments

dre2phresh’s picture

I'm also looking for this! Any luck yet?

neopoet’s picture

Not yet. Something like this exists now in private messages, but it's a bit of a hack (we should suggest to them that it would be simpler to rely on the date module for this, rather than implementing it internally).

patcon’s picture

subscribe

karens’s picture

Status: Active » Fixed

There is a formatter called the 'interval' format, you see it on the Display Fields screen. This should display a date field this way.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Yuri’s picture

In views there is a custom date format (on the date field configuration page), but it only allows for one line of custome php date format, with a reference to http://us.php.net/manual/en/function.date.php. a recent comment shows this code:

A smaller "time since incident" example that takes a datetime string as input :

<?php function timesince( $tsmp ) {

$diffu = array(  'seconds'=>2, 'minutes' => 120, 'hours' => 7200, 'days' => 172800, 'months' => 5259487,  'years' =>  63113851 );
$diff = time() - strtotime($tsmp);
$dt = '0 seconds ago';
foreach($diffu as $u => $n){ if($diff>$n) {$dt = floor($diff/(.5*$n)).' '.$u.' ago';} }

return $dt;
}

?>

// example output: 10 seconds ago / 90 minutes ago / 16 months ago / 3 years ago

How could i insert this function in the date field format?

Yuri’s picture

Priority: Minor » Normal
Status: Closed (fixed) » Needs review
karens’s picture

Status: Needs review » Closed (works as designed)
StatusFileSize
new54.32 KB

As noted in #4, there is already a formatter for this, on both the Display Fields screen and in Views. In Views it looks like this: