Secured future date input + min(end,now) for complete_to_end
This commit is contained in:
@ -12,6 +12,11 @@ class DatesPopup extends HTMLElement{
|
||||
|
||||
getDateTimeInput(){
|
||||
let dateInputValue = this.getElementsByClassName("input-date")[0].valueAsDate;
|
||||
let today = new Date();
|
||||
if(dateInputValue > today){
|
||||
dateInputValue = today;
|
||||
alertify.warning("Date in the future : using today");
|
||||
}
|
||||
dateInputValue.setHours(0,0,0,0);
|
||||
let formattedHour = this.getElementsByClassName("input-time")[0].value;
|
||||
let timeMs = this.convertTimeStringToTimestamp(formattedHour);
|
||||
@ -62,6 +67,7 @@ class DatesPopup extends HTMLElement{
|
||||
this.hide();
|
||||
this.getElementsByTagName("img")[0].onclick = () => {this.hide();};
|
||||
this.getElementsByClassName("go-to-now-button")[0].onclick = () => {this.doGoToNowCallback();};
|
||||
this.getElementsByClassName("input-date")[0].max = new Date().toISOString().split("T")[0]; // sets the max to today (set only at app start)
|
||||
this.getElementsByClassName("jump-button-time")[0].onclick = () => {this.doJumpTimeCallback();};
|
||||
this.getElementsByClassName("jump-button-all")[0].onclick = () => {this.doJumpAllCallback();};
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class InfluxGraph:
|
||||
result = self.influx_data_getter.get_curves_in_timerange(self.variables, self.time, interval)
|
||||
|
||||
self.strip_future(result)
|
||||
self.complete_to_end(result, end)
|
||||
self.complete_to_end(result, min(end, now))
|
||||
self.time[0] = self.time[1]
|
||||
# reduction not yet implemented
|
||||
return dict(type='graph-draw', reduced=False, graph=result)
|
||||
|
Reference in New Issue
Block a user