How to display Start and END of an event

For discussing the Mozilla Calendar, Sunbird and Lightning projects.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: How to display Start and END of an event

Post by morat »

You're welcome.
fredcom
Posts: 24
Joined: August 25th, 2014, 6:21 am

Re: How to display Start and END of an event

Post by fredcom »

hi,
Following an update of thunderbird, display of Start and EndTime is not working anymore in monthview with the previous hack.
I can still find a file calendar-month-view.js in omni.ja, but once edited, there is no more "startTime" or "endTime", so I don't find a way to modify for the result expected.
Any ideas to proceed?

edit: for an agenda software like "EssentialPIM", in settings, there is a choice : "show for appointments : start & end time"
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: How to display Start and END of an event

Post by morat »

Try this:

Code: Select all

  parentTime.isDate = false;
+ var _startTime = val.startDate.getInTimezone(this.parentBox.date.timezone);
+ var _endTime = val.endDate.getInTimezone(this.parentBox.date.timezone);

Code: Select all

- this.timeLabel.textContent = displayTime;
+ if (typeof _startTime === "undefined" || typeof _endTime === "undefined") {
+   this.timeLabel.textContent = displayTime;
+ } else {
+   this.timeLabel.textContent = cal.dtz.formatter.formatTime(_startTime) + " " + cal.dtz.formatter.formatTime(_endTime);
+ }
I did not test the hack with Thunderbird 102.

Reference
http://searchfox.org/comm-esr91/search? ... &path=view
http://searchfox.org/comm-esr102/search ... &path=view
fredcom
Posts: 24
Joined: August 25th, 2014, 6:21 am

Re: How to display Start and END of an event

Post by fredcom »

Hi morat,
thanks for your interest.
I'm using TB 102.
Accordind to your message, I tried these changes in calendar-month-view.js :

Code: Select all

// Convert to the date-time for the start of the day.
parentTime.isDate = false;
+  var _startTime = val.startDate.getInTimezone(this.parentBox.date.timezone);
+  var _endTime = val.endDate.getInTimezone(this.parentBox.date.timezone);

Code: Select all

if (displayTime) {
- this.timeLabel.textContent = displayTime;
+ if (typeof _startTime === "undefined" || typeof _endTime === "undefined") {
+   this.timeLabel.textContent = displayTime;
+ } else {
+   this.timeLabel.textContent = cal.dtz.formatter.formatTime(_startTime) + " " + cal.dtz.formatter.formatTime(_endTime);
+ }
saved in omni.ja, then replaced, then : thunderbird.exe -purgecaches
but no change in the time display (no errors also), as timelabel doesn't seem to take into account starttime and endtime
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: How to display Start and END of an event

Post by morat »

The hack works here.

Screenshot
http://imgur.com/a/rr5KfQG

Tested with:

Thunderbird Portable 102.4.0 (fresh install)
Windows 10 Pro 21H2 32-bit

I edited the omni.ja file using command prompt like so...

Code: Select all

cd /d C:\ThunderbirdPortable\App\Thunderbird
unzip.exe -l omni.ja | find "calendar-month-view.js"
unzip.exe omni.ja chrome\calendar\content\calendar-month-view.js
notepad.exe chrome\calendar\content\calendar-month-view.js
zip.exe omni.ja chrome\calendar\content\calendar-month-view.js
C:\ThunderbirdPortable\ThunderbirdPortable.exe -purgecaches
AFAICT, the omni.ja file is a normal zip file. (not optimized)

Here is how to view the calendar-month-view.js file using the error console.

Code: Select all

document.getElementById("tabmail").openTab("contentTab", {
  url: "view-source:chrome://calendar/content/calendar-month-view.js",
});
P.S.

Can you get the following hack to work?

Code: Select all

  if (displayTime) {
-   this.timeLabel.textContent = displayTime;
+   this.timeLabel.textContent = displayTime + " XXX";
I assume you know how to edit the calendar-month-view.js file using my hacks.

* don't change lines preceded by space character
* remove lines preceded by minus sign
* add lines preceded by plus sign

Remember to remove the leading plus sign in the added lines.
fredcom
Posts: 24
Joined: August 25th, 2014, 6:21 am

Re: How to display Start and END of an event

Post by fredcom »

Hi morat,
it works well. =D>
So thank you, your are so helpful.
I apoligise because I probably make a wrong copy the first time and didn't crosscheck, my mistake.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: How to display Start and END of an event

Post by morat »

You're welcome.
Post Reply