Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#1483879 closed Feature Requests (fixed)

No entry in config to change date/time format for today's emails.

Reported by: darkcoder Owned by:
Priority: 5 Milestone: later
Component: Core functionality Version: 0.1-beta
Severity: normal Keywords:
Cc:

Description

The format used to display the time of emails that arrive the same day (today) is a 24 hour militar time hardcoded in program/include/main.inc

There should be a way to change that in the config file in the same way as the short/long date formats.

Below are some diffs I have done to add a new variable that allow the admin to also specify the hour format for emails received "Today".

config/main.inc.php

diff -urN roundcubemail.orig/config/main.inc.php roundcubemail/config/main.inc.php
--- roundcubemail.orig/config/main.inc.php       2006-07-06 02:36:37.000000000 -0400
+++ roundcubemail/config/main.inc.php   2006-07-06 02:37:11.000000000 -0400
@@ -102,6 +102,9 @@
 // the default locale setting
 $rcmail_config['locale_string'] = '';

+// use this format for emails that arrived today
+$rcmail_config['today_date'] = 'H:i';
+
 // use this format for short date display
 $rcmail_config['date_short'] = 'D H:i';

program/include/main.inc

diff -urN roundcubemail.orig/program/include/main.inc roundcubemail/program/include/main.inc
--- roundcubemail.orig/program/include/main.inc  2006-07-02 14:07:04.000000000 -0400
+++ roundcubemail/program/include/main.inc      2006-07-06 02:26:43.000000000 -0400
@@ -1533,7 +1533,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['today_date'] ? $CONFIG['today_date'] : 'H:i', $timestamp));
   else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit)
     $format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i';
   else if (!$format)

Code has also been included to provide the standard 'H:i' format in case the new variable today_date is not defined.

This change was applied to the svn trunk version 269

Attachments (1)

today_date.diff (1.2 KB) - added by darkcoder 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by darkcoder

comment:1 Changed 7 years ago by darkcoder

  • Component changed from Client to Core functionality
  • Milestone 0.1rc1 deleted
  • Version changed from 0.1-beta to later

comment:2 Changed 7 years ago by mmarques

The patch to config/main.inc.php should really go to config/main.inc.php.dist, asi the former one doesn't exist in the SVN trunk. ;-)

comment:3 Changed 7 years ago by thomasb

  • Milestone set to later
  • Type changed from Bugs to Feature Requests
  • Version changed from later to 0.1-beta

More a feature request than a bug

comment:4 Changed 7 years ago by darkcoder

If you change your date format to the US standard 12-hour format, then will understand that it looks more like a bug, than a request when you'll see not all entries change to the new format.

I can provide an updated diff in case needed.

comment:5 Changed 6 years ago by darkcoder

  • Resolution set to fixed
  • Status changed from new to closed

Closing since it has been included in SVN 423 with a similar patch submitted by Doug Mandell recently.

Note: See TracTickets for help on using tickets.