Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
Add back localized time with tag localeTime
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
mikehardy committed May 28, 2020
1 parent e800e6b commit f786420
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chrome/thunderlink/content/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<label control="csLabel" value="You can use the following placeholders:"/>
<spacer size="5"/>
<label control="csLabel" value="&#60;thunderlink&#62; &#60;messageid&#62; &#60;subject&#62; &#60;filteredSubject&#62;"/>
<label control="csLabel" value="&#60;tbexe&#62; &#60;dateTime&#62; &#60;date&#62; &#60;time&#62;"/>
<label control="csLabel" value="&#60;tbexe&#62; &#60;dateTime&#62; &#60;date&#62; &#60;time&#62; &#60;localeTime&#62;"/>
<label control="csLabel" value="&#60;sender&#62; &#60;senderName&#62; &#60;senderEmail&#62;"/>
<separator class="groove-thin"/>
<label control="csLabel" value="Some characters need to be escaped with baskslash:"/>
Expand Down
2 changes: 2 additions & 0 deletions modules/thunderlinkModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ function replaceVariables(template, hdr) {
const splitDateTime = date.toISOString().split("T");
const dateString = splitDateTime[0];
const timeString = splitDateTime[1].substring(0, splitDateTime[1].length-1);
const localeDateString = date.toLocaleDateString() + " - " + date.toLocaleTimeString();
result = result.replace(/<localeTime>/ig, localeDateString);
result = result.replace(/<time>/ig, isoDate);
result = result.replace(/<date>/ig, dateString);
result = result.replace(/<dateTime>/ig, timeString);
Expand Down

0 comments on commit f786420

Please sign in to comment.