We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
trusted-set-local-storage-item
1 parent f0cfc77 commit 2ccc313Copy full SHA for 2ccc313
assets/resources/scriptlets.js
@@ -1052,12 +1052,14 @@ function setLocalStorageItemFn(
1052
];
1053
1054
if ( trusted ) {
1055
- if ( value === '$now$' ) {
1056
- value = Date.now();
1057
- } else if ( value === '$currentDate$' ) {
1058
- value = `${Date()}`;
1059
- } else if ( value === '$currentISODate$' ) {
1060
- value = (new Date()).toISOString();
+ if ( value.includes('$now$') ) {
+ value.replaceAll('$now$', Date.now());
+ }
+ if ( value.includes('$currentDate$') ) {
+ value.replaceAll('$currentDate$', `${Date()}`);
1061
+ if ( value.includes('$currentISODate$') ) {
1062
+ value.replaceAll('$currentISODate$', (new Date()).toISOString());
1063
}
1064
} else {
1065
const normalized = value.toLowerCase();
0 commit comments