aboutsummaryrefslogtreecommitdiffstats
path: root/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'main.js')
-rw-r--r--main.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/main.js b/main.js
index d9df4c0..0d1c7fb 100644
--- a/main.js
+++ b/main.js
@@ -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;