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

Commit f786420

Browse files
committed
Add back localized time with tag localeTime
Fixes #63
1 parent e800e6b commit f786420

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

chrome/thunderlink/content/preferences.xul

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<label control="csLabel" value="You can use the following placeholders:"/>
109109
<spacer size="5"/>
110110
<label control="csLabel" value="&#60;thunderlink&#62; &#60;messageid&#62; &#60;subject&#62; &#60;filteredSubject&#62;"/>
111-
<label control="csLabel" value="&#60;tbexe&#62; &#60;dateTime&#62; &#60;date&#62; &#60;time&#62;"/>
111+
<label control="csLabel" value="&#60;tbexe&#62; &#60;dateTime&#62; &#60;date&#62; &#60;time&#62; &#60;localeTime&#62;"/>
112112
<label control="csLabel" value="&#60;sender&#62; &#60;senderName&#62; &#60;senderEmail&#62;"/>
113113
<separator class="groove-thin"/>
114114
<label control="csLabel" value="Some characters need to be escaped with baskslash:"/>

modules/thunderlinkModule.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ function replaceVariables(template, hdr) {
187187
const splitDateTime = date.toISOString().split("T");
188188
const dateString = splitDateTime[0];
189189
const timeString = splitDateTime[1].substring(0, splitDateTime[1].length-1);
190+
const localeDateString = date.toLocaleDateString() + " - " + date.toLocaleTimeString();
191+
result = result.replace(/<localeTime>/ig, localeDateString);
190192
result = result.replace(/<time>/ig, isoDate);
191193
result = result.replace(/<date>/ig, dateString);
192194
result = result.replace(/<dateTime>/ig, timeString);

0 commit comments

Comments
 (0)