diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2025-06-11 12:40:26 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2025-06-11 12:41:45 +0200 |
commit | eca83243629e61ee73d4f6b6e88c2e28b47face9 (patch) | |
tree | 291fb51e9125adb70b7d668f81508a79ed34aa48 | |
parent | 78b07067b4aba79fa0b5f282a067856f41e9ab31 (diff) |
Rename “age” to “ts”.
Cf. 231d64cbd14c2d1ccb6468dc9666d4433e39834c in tools.
-rw-r--r-- | main.js | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -158,9 +158,9 @@ const age_filter_settings = { } return d; }, - _min_age: null, - _max_age: null, - _date_to_age: function(d) { + _min_ts: null, + _max_ts: null, + _date_to_ts: function(d) { if (d == null) { return null; } @@ -168,17 +168,17 @@ const age_filter_settings = { return Math.floor(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())/86_400_000); }, setup_minmax: function() { - this._min_age = this._max_age = null; + this._min_ts = this._max_ts = null; switch (this.type) { case 'relative': { const date = this.get_relative_date(this.quantity, this.unit); - const prop = {'<=':'_min_age', '>=':'_max_age'}[this.operator]; - this[prop] = this._date_to_age(date); + const prop = {'<=':'_min_ts', '>=':'_max_ts'}[this.operator]; + this[prop] = this._date_to_ts(date); break; } case 'interval': { - this._min_age = this._date_to_age(this.from); - this._max_age = this._date_to_age(this.to); + this._min_ts = this._date_to_ts(this.from); + this._max_ts = this._date_to_ts(this.to); break; } } @@ -4547,13 +4547,13 @@ const [mapLayers, featureOverlayLayer] = (function() { if (age_filter_settings.active) { /* TODO avoid doing this checks for each feature; instead, set up a * different style function if age_filter_settings.active */ - const age = properties.age; - if (age == null) { + const ts = properties.ts; + if (ts == null) { if (!age_filter_settings.show_unknown) { return null; } - } else if ((age_filter_settings._min_age !== null && age < age_filter_settings._min_age) || - (age_filter_settings._max_age !== null && age > age_filter_settings._max_age)) { + } else if ((age_filter_settings._min_ts !== null && ts < age_filter_settings._min_ts) || + (age_filter_settings._max_ts !== null && ts > age_filter_settings._max_ts)) { return null; } } @@ -5396,7 +5396,7 @@ const infoMetadataAccordions = []; return x.radio.checked; })[0]; let param; - age_filter_settings._min_age = age_filter_settings._max_age = null; + age_filter_settings._min_ts = age_filter_settings._max_ts = null; switch (filter_type) { case 'relative': { const operator = age_filter_settings.operator = filter_settings.operator[0].value; |