Bug 1086573 - Lightning and Thunderbird disagree about timezone support in ics files. r/a=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Thu, 23 Apr 2015 13:39:31 +0200
changeset 25967 7640c298db787ffd8726aa07523cd15d85f2b11c
parent 25966 0111428ad28326da39f72f04f9c19790f0693941
child 25968 95caf9355ce26ee3d4bfde69fc22bbc3a8ba50d0
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1086573
Bug 1086573 - Lightning and Thunderbird disagree about timezone support in ics files. r/a=philipp
calendar/base/content/calendar-item-bindings.xml
--- a/calendar/base/content/calendar-item-bindings.xml
+++ b/calendar/base/content/calendar-item-bindings.xml
@@ -71,23 +71,27 @@
                   }
                   headerLabel.value = label;
               }
           }
           var hideLabels = (date == null);
           if (hideLabels) {
               this.setAttribute("hidden", "true");
           } else {
+              const kDefaultTimezone = cal.calendarDefaultTimezone();
+              let localTime = date.getInTimezone(kDefaultTimezone);
+              let formatter = getDateFormatter();
+              itemDateTimeLabel.value = formatter.formatDateTime(localTime);
+              if (date.timezone.tzid != kDefaultTimezone.tzid) {
+                  // we additionally display the original datetime with timezone
+                  let orgTime = cal.calGetString("calendar",
+                                                 "datetimeWithTimezone",
+                                                 [formatter.formatDateTime(date),
+                                                  date.timezone.tzid]);
+                  itemDateTimeLabel.value += " (" + orgTime + ")";
+              }
               this.removeAttribute("hidden");
-              var label = getDateFormatter().formatDateTime(date);
-              if (date.timezone.tzid != calendarDefaultTimezone().tzid) {
-                  itemDateTimeLabel.value = calGetString("calendar",
-                                            "datetimeWithTimezone",
-                                            [label, date.timezone.tzid]);
-              } else {
-                  itemDateTimeLabel.value = label;
-              }
           }
         ]]></setter>
       </property>
     </implementation>
   </binding>
 </bindings>