aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.js b/main.js
index c0a3186..0a2449c 100644
--- a/main.js
+++ b/main.js
@@ -2656,6 +2656,9 @@ const STYLES = {};
/* eslint-disable-next-line no-useless-escape */
const m0 = /^([ +\-]?)([0-9]+)([dwmy])$/.exec(value);
if (m0 != null) {
+ /* handling relative parameter values add some complexity, but it's worth doing since
+ * users can bookmark the URL with e.g., age-filter=-1y and visit it later with the
+ * timeframe shifted forward, thus not having to reconfigure the age filter */
ageFilterSettings.type = 'relative';
ageFilterSettings.operator = (m0[1] === ' ' || m0[1] === '+' || m0[1] === '') ? '>='
: m0[1] === '-' ? '<='
@@ -5318,6 +5321,7 @@ const ageFilterSetActive = (function() {
ageFilterSettings._min_ts = ageFilterSettings._max_ts = null;
switch (filter_type) {
case 'relative': {
+ /* save relative value so it can be autoshifted later */
const operator = ageFilterSettings.operator = filter_settings.operator[0].value;
ageFilterSettings.quantity = parseInt(filter_settings.quantity.value, 10);
ageFilterSettings.unit = filter_settings.unit[0].value;