Skip to content
Permalink
Browse files
Use ISO8061 dates in filter comments
  • Loading branch information
C0rn3j authored and hawkeye116477 committed Aug 11, 2020
1 parent 149e30f commit cedba5ce2979c62cca665a7f6cdc4bbf479716b3
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/js/storage.js
@@ -420,10 +420,13 @@
this.hiddenSettings.autoCommentFilterTemplate.indexOf('{{') !== -1
) {
const d = new Date();
// Date in YYYY-MM-DD format - https://stackoverflow.com/a/50130338
const ISO8061Date = new Date(d.getTime() +
(d.getTimezoneOffset()*60000)).toISOString().split('T')[0];
comment =
'! ' +
this.hiddenSettings.autoCommentFilterTemplate
.replace('{{date}}', d.toLocaleDateString())
.replace('{{date}}', ISO8061Date)
.replace('{{time}}', d.toLocaleTimeString())
.replace('{{origin}}', options.origin);
}

0 comments on commit cedba5c

Please sign in to comment.