Skip to content

Commit

Permalink
bugfix web ui climate data explorer end date selection in dependence …
Browse files Browse the repository at this point in the history
…of start date
  • Loading branch information
swoellauer committed Oct 6, 2020
1 parent c1e2741 commit aaa26f9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tsdb/TsDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class TsDB implements AutoCloseable {
private static final Logger log = LogManager.getLogger();

public static final String tubedb_version = "1.17.2";
public static final String tubedb_version = "1.17.3";

/**
* map regionName -> Region
Expand Down
2 changes: 1 addition & 1 deletion webcontent/visualisation_meta/visualisation_meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ <h3>plots</h3>
<td>
<select @focus="timeHoverStay = true" @blur="timeHoverStay = false" v-model="timeDayEnd" :class="[ { just_hide: timeYearEnd === '' || timeMonthEnd === ''}]">
<option></option>
<option v-for="d in timeDays">{{d}}</option>
<option v-for="d in timeDayEnds">{{d}}</option>
</select>
</td>
</tr>
Expand Down
30 changes: 30 additions & 0 deletions webcontent/visualisation_meta/visualisation_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,21 @@ computed: {
}
return this.timeMonths.filter(m => this.timeMonthsNumber[m] >= this.timeMonthsNumber[this.timeMonth]);
},
timeDayEnds: function() {
if(this.timeMonthEnd === '') {
return this.timeDays;
}
if(this.timeMonth === '*') {
return this.timeDays;
}
if(this.timeMonth !== this.timeMonthEnd) {
return this.timeDays;
}
if(this.timeDay === '*') {
return this.timeDays;
}
return this.timeDays.filter(d => +d >= +this.timeDay);
},
}, //end computed

mounted: function () {
Expand Down Expand Up @@ -996,6 +1011,21 @@ watch: {
}
}
},
timeYearEnds: function() {
if(this.timeYearEnds.every(y => y != this.timeYearEnd)) {
this.timeYearEnd = '';
}
},
timeMonthEnds: function() {
if(this.timeMonthEnds.every(m => m != this.timeMonthEnd)) {
this.timeMonthEnd = '';
}
},
timeDayEnds: function() {
if(this.timeDayEnds.every(m => m != this.timeDayEnd)) {
this.timeDayEnd = '';
}
},
}, //end watch

}); //end visualisation-interface
Expand Down

0 comments on commit aaa26f9

Please sign in to comment.