Appending long form Date to Subject line

User Help for Mozilla Thunderbird
Post Reply
davexl
Posts: 23
Joined: January 30th, 2021, 2:24 am
Location: Auckland NZ

Appending long form Date to Subject line

Post by davexl »

Thunderbird 102.8 - Appending long form Date to Subject line in Compose via shortcut / keyword

Can anyone help me solve this one please ?
Have looked thru T/Bird options but can't find solution.

Have installed Quicktext extension, but am no programmer and can't workout the script file, assuming
Quicktext is the right extension to use.

Thanks for any help for this newby.
Cheers
Davexl
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Appending long form Date to Subject line

Post by morat »

Try something like:

Code: Select all

var subjElem = this.mWindow.document.getElementById("msgSubject");
if (!subjElem) {
  return "";
}
var now = new Date();
var dateTimeFormatter = new this.mWindow.Services.intl.DateTimeFormat("en-US", {
  dateStyle: "long",
  timeStyle: "long",
});
if (subjElem.value) {
  subjElem.value = subjElem.value + " " + dateTimeFormatter.format(now);
} else {
  subjElem.value = dateTimeFormatter.format(now);
}
return "";
That script is similar to the CleanSubject script.

Quicktext
http://addons.thunderbird.net/thunderbird/addon/640
http://github.com/jobisoft/quicktext/wi ... ty-scripts
http://github.com/jobisoft/quicktext/wi ... eanSubject

Reference
http://developer.mozilla.org/en-US/docs ... TimeFormat
davexl
Posts: 23
Joined: January 30th, 2021, 2:24 am
Location: Auckland NZ

Re: Appending long form Date to Subject line

Post by davexl »

Thanks you so much for your help!
Much appreciated!
Post Reply