Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include timezone at top message of quotation #7352

Open
metalefty opened this issue Apr 28, 2020 · 3 comments
Open

include timezone at top message of quotation #7352

metalefty opened this issue Apr 28, 2020 · 3 comments

Comments

@metalefty
Copy link

Hi,

Quoted messages start with:

On 2020-04-28 10:48, Steve Jobs wrote:

but it is a quoter's local time. It is a little bit inconvenient.

However, not only a few people exchanges email internationally. So what about a more helpful format including a time zone like this?

On Tue, Apr 28, 2020 at 10:35:20AM +0900, Steve Jobs wrote:

@alecpl
Copy link
Member

alecpl commented Apr 29, 2020

I guess we could do that. Mutt and Claws Mail do that (I don't know if by default).

@MiMoHo
Copy link

MiMoHo commented Mar 27, 2023

It would be beneficial to see the timezone also in the email viewer and when printing an email. For some services, it is critical to know the timezone to check for en email on their end! Can you implement both changes @alecpl ?

@metalefty
Copy link
Author

I tried to create an in-house implementation. However, the original timezone is converted to local timezone regardless the 3rd argument is set to false.

diff --git a/program/actions/mail/compose.php b/program/actions/mail/compose.php
index 900fc8161..7efa61b98 100644
--- a/program/actions/mail/compose.php
+++ b/program/actions/mail/compose.php
@@ -890,7 +890,7 @@ class rcmail_action_mail_compose extends rcmail_action_mail_index
         return $rcmail->gettext([
             'name' => 'mailreplyintro',
             'vars' => [
-                'date' => $rcmail->format_date($message->get_header('date'), $rcmail->config->get('date_long')),
+                'date' => $rcmail->format_date($message->get_header('date'), 'c', false),
                 'sender' => !empty($from['name']) ? $from['name'] : rcube_utils::idn_to_utf8($from['mailto']),
             ],
         ]);
@@ -916,7 +916,7 @@ class rcmail_action_mail_compose extends rcmail_action_mail_index
         }

         $rcmail = rcmail::get_instance();
-        $date = $rcmail->format_date($message->get_header('date'), $rcmail->config->get('date_long'));
+        $date = $rcmail->format_date($message->get_header('date'), 'c', false);

         if (!$bodyIsHtml) {
             $prefix = "\n\n\n-------- " . $rcmail->gettext('originalmessage') . " --------\n";
    /**
     * Convert the given date to a human readable form
     * This uses the date formatting properties from config
     *
     * @param string|int|DateTime|DateTimeImmutable $date    Date representation
     * @param string                                $format  Date format to use
     * @param bool                                  $convert Enables date conversion according to user timezone
     *
     * @return string Formatted date string
     */
    public function format_date($date, $format = null, $convert = true)
    {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants