Patch to allow 12 hour date to display for emails sent today.

Doug Mandell dmandell at gristle.org
Mon Dec 11 09:57:18 CET 2006


Whoops, meant to send this to the list.  Anyhow, here's the fixed version of my patch, if there's a better way for me to submit these please let me know.

Thanks,

Doug

Index: roundcubemail/config/main.inc.php.dist
===================================================================
--- roundcubemail/config/main.inc.php.dist      (revision 400)
+++ roundcubemail/config/main.inc.php.dist      (working copy)
@@ -107,6 +107,9 @@
 // the default locale setting
 $rcmail_config['locale_string'] = 'en';

+// use this format for today's date display
+$rcmail_config['date_today'] = 'H:i';
+
 // use this format for short date display
 $rcmail_config['date_short'] = 'D H:i';

Index: roundcubemail/program/include/main.inc
===================================================================
--- roundcubemail/program/include/main.inc      (revision 400)
+++ roundcubemail/program/include/main.inc      (working copy)
@@ -1687,7 +1687,7 @@

   // define date format depending on current time
   if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit)
-    return sprintf('%s %s', rcube_label('today'), date('H:i', $timestamp));
+    return sprintf('%s %s', rcube_label('today'), date($CONFIG['date_today'] ?
$CONFIG['date_today'] : 'H:i', $timestamp));
   else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit)
     $format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i';
   else if (!$format)





More information about the Dev mailing list