Skip to content

Commit 070f796

Browse files
Update popup/popup.js
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 145f860 commit 070f796

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

popup/popup.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ const nowLocal = new Date(now.getTime() - now.getTimezoneOffset() * 60000);
187187
"{{now.unix_ms}}": now.getTime(),
188188
"{{now.year}}": now.getUTCFullYear(),
189189
"{{now.month}}": now.getUTCMonth() + 1,
190-
"{{now.day}}": now.getUTCDate(),
190+
"{{now.local.iso}}": (() => {
191+
const offsetMinutes = now.getTimezoneOffset();
192+
const sign = offsetMinutes > 0 ? "-" : "+";
193+
const hours = ("0" + Math.floor(Math.abs(offsetMinutes / 60))).slice(-2);
194+
const minutes = ("0" + Math.abs(offsetMinutes % 60)).slice(-2);
195+
return nowLocal.toISOString().slice(0, -1) + sign + hours + ":" + minutes;
196+
})(),
191197
"{{now.hour}}": now.getUTCHours(),
192198
"{{now.minute}}": now.getUTCMinutes(),
193199
"{{now.second}}": now.getUTCSeconds(),

0 commit comments

Comments
 (0)