By default the Privatemsg Module has three timestamp displays for various lengths the message has been sent. After a certain point the listed 'time' changes.
What I want to do is append the next timestamp to the end of the current one. This way it remains the details of minutes and date posted as time moves forward.
Example: after 24hrs, instead of it just saying 'Oct 8' I want it to say 'oct 8 12:45' and after a year '2014 oct 8 12:45'
I think I found the code in the module where timestamps are printing, I just can't figure out how to add to it.
function privatemsg_date_formats() {
$formats = array('g:i a', 'H:i', 'M j', 'j M', 'm/d/y', 'd/m/y', 'j/n/y', 'n/j/y');
$types = array_keys(privatemsg_date_format_types());
$date_formats = array();
foreach ($types as $type) {
foreach ($formats as $format) {
$date_formats[] = array(
'type' => $type,
'format' => $format,
'locales' => array(),
);
}
}
return $date_formats;
}
function privatemsg_date_format_types() {
return array(
'privatemsg_current_day' => t('Privatemsg: Current day'),
'privatemsg_current_year' => t('Privatemsg: Current year'),
'privatemsg_years' => t('Privatemsg: Other years'),
);
}
function privatemsg_format_date($timestamp) {
if ($timestamp > ((int)(REQUEST_TIME / 3600)) * 3600) {
return t('@interval ago', array('@interval' => format_interval(abs(REQUEST_TIME - $timestamp), 1)));
}
if ($timestamp > ((int)(REQUEST_TIME / 86400)) * 86400) {
return format_date($timestamp, 'privatemsg_current_day');
}
if ($timestamp > mktime(0, 0, 0, 1, 0, date('Y'))) {
return format_date($timestamp, 'privatemsg_current_year');
}
return format_date($timestamp, 'privatemsg_years');
}