Open Bug 736730 Opened 12 years ago Updated 2 years ago

Date not formatted in expandedHeaders since Thunderbird 10. Enhance extraExpandedHeaders pref to support a display name for the field, e.g. "Date=X-Mozilla-LocalizedDate"

Categories

(Thunderbird :: Message Reader UI, defect)

10 Branch
x86
All
defect

Tracking

(Not tracked)

People

(Reporter: mozilla, Unassigned)

References

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
Build ID: 20120306064154

Steps to reproduce:

Set mailnews.headers.extraExpandedHeaders and hid the datetime shown on the right side.


Actual results:

Up to Thunderbird 9 it showed the date formatted as everywhere else. Since Thunderbird 10 it doesn't get formatted anymore.


Expected results:

The date should be formatted there too.
'Set mailnews.headers.extraExpandedHeaders to "Date" ...' it should be above in steps to reproduce.
This is intentional. The "Date" field was the only header field that was treated specially and changed from its real value when being passed to the UI. That caused problems elsewhere (see bug 544359), so now we emit a separate, synthetic header for the localized version of the date: "X-Mozilla-LocalizedDate".
Okay, that makes sense.

Two questions though:

- according to the comments in the mentioned bug, isn't the label supposed to be renamed to "Date"? It now shows "X-Mozilla-LocalizedDate"
- is there a way to remove the time zone offset? It localizes the date but that information isn't removed (e.g. "17.03.2012 15:56 +0000)
(In reply to Matthias Schoettle from comment #3)
> Okay, that makes sense.
> 
> Two questions though:
> 
> - according to the comments in the mentioned bug, isn't the label supposed
> to be renamed to "Date"? It now shows "X-Mozilla-LocalizedDate"

I think that's how an older version of the patch worked, but things didn't work quite right with that version. I prefer this way, since I think it's more explicit. However, I can see why this would be bothersome for some people (the field is a bit long), so I wouldn't mind enhancing the extraExpandedHeaders pref to support a display name for the field, e.g. "Date=X-Mozilla-LocalizedDate".

> - is there a way to remove the time zone offset? It localizes the date but
> that information isn't removed (e.g. "17.03.2012 15:56 +0000)

The X-Mozilla-LocalizedDate field should be identical to the date as shown on the right side of the header pane. If it's showing a time zone offset, I'm guessing that's because of the locale you're using.
(In reply to Jim Porter (:squib) from comment #4)

> I think that's how an older version of the patch worked, but things didn't
> work quite right with that version. I prefer this way, since I think it's
> more explicit. However, I can see why this would be bothersome for some
> people (the field is a bit long), so I wouldn't mind enhancing the
> extraExpandedHeaders pref to support a display name for the field, e.g.
> "Date=X-Mozilla-LocalizedDate".

Yes, it indeed is a bit long and thus it would be great to either be able to let the user change the label name (as you suggested). 
Or, I was wondering if it is possible to take the localized name for the date label (dateField3.label) for this label as well. Or even its own could be created. That way a user with a different locale would see the localized name for it.

If a get how it works correctly it might even be sufficient to add a corresponding row (including the label) to msgHdrOverlay.xul:

<row id="expandedx-mozilla-localizeddateRow" collapsed="true">
    <label id="expandedx-mozilla-localizeddateLabel" class="headerName"
        value="&dateField3.label;" control="expandedx-mozilla-localizeddateBox"/>
    <mail-headerfield id="expandedx-mozilla-localizeddataBox" flex="1"/>
</row>

> The X-Mozilla-LocalizedDate field should be identical to the date as shown
> on the right side of the header pane. If it's showing a time zone offset,
> I'm guessing that's because of the locale you're using.

Sorry, that was a wrong configuration on my side (mailnews.display.date_senders_timezone set to true).
What next?
Matthias, can you work up a patch for review?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mozilla)
Keywords: regression
OS: Windows XP → All
See Also: → 544359
Summary: Date not formatted in expandedHeaders since Thunderbird 10 → Date not formatted in expandedHeaders since Thunderbird 10. Enhance extraExpandedHeaders pref to support a display name for the field, e.g. "Date=X-Mozilla-LocalizedDate"
(In reply to Wayne Mery (:wsmwk) from comment #7)
> Matthias, can you work up a patch for review?

Wayne, thanks for keeping track of this. I am not sure if this is still really useful. I honestly haven't missed it (anymore) in recent years. 

While it could be nice to have all the header info in the same place, it only makes sense if the date on the right-hand side under the toolbar is hidden. I am not aware of such an option, however.

However, if this is valuable change, I am happy to work up a patch.
Flags: needinfo?(mozilla)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.