Fixed view per day overflow risk
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir 2023-06-25 23:26:35 +02:00
parent 816cbe69fb
commit 05436de309
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -136,12 +136,15 @@ const app = new Vue({
next_step: function(){ next_step: function(){
this.journey_step_data.day += 1; this.journey_step_data.day += 1;
let s = this.journey_step_data.section; let s = this.journey_step_data.section;
let cd = ((this.journey_data.main[s].dateRange[1]-this.journey_data.main[s].dateRange[0])/(1000*60*60*24))+1; let cd = this.journey_data.main[s].dateRange?
((this.journey_data.main[s].dateRange[1]-this.journey_data.main[s].dateRange[0])/(1000*60*60*24))+1 :
0;
if(this.journey_step_data.day>cd){ if(this.journey_step_data.day>cd){
this.journey_step_data.section +=1; this.journey_step_data.section +=1;
if(this.journey_step_data.section>=this.journey_data.main.length){ if(this.journey_step_data.section>=this.journey_data.main.length){
this.first_step(); this.journey_step_data.section = this.journey_data.main.length-1;
this.journey_step_data.day = 1;
}else{ }else{
this.journey_step_data.day = 1; this.journey_step_data.day = 1;
} }
@ -156,7 +159,10 @@ const app = new Vue({
this.first_step(); this.first_step();
}else{ }else{
let s = this.journey_step_data.section; let s = this.journey_step_data.section;
let cd = ((this.journey_data.main[s].dateRange[1]-this.journey_data.main[s].dateRange[0])/(1000*60*60*24))+1;
let cd = this.journey_data.main[s].dateRange?
((this.journey_data.main[s].dateRange[1]-this.journey_data.main[s].dateRange[0])/(1000*60*60*24))+1 :
0;
this.journey_step_data.day = cd ; this.journey_step_data.day = cd ;
} }
} }