Added fallback if missing dates
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d8ab504bcd
commit
29067f4807
@ -200,14 +200,18 @@ const app = new Vue({
|
||||
|
||||
total_days: function(){
|
||||
if(this.journey_data.main.length==0) return 0;
|
||||
return (this.journey_data.main[this.journey_data.main.length-1].dateRange[0]-this.journey_data.main[0].dateRange[0])/(1000*60*60*24)
|
||||
try{
|
||||
return (this.journey_data.main[this.journey_data.main.length-1].dateRange[0]-this.journey_data.main[0].dateRange[0])/(1000*60*60*24)
|
||||
}catch{
|
||||
return '?'
|
||||
}
|
||||
},
|
||||
total_date: function(){
|
||||
if(this.journey_data.main.length==0) return '';
|
||||
try{
|
||||
return `${this.format_date(this.journey_data.main[0].dateRange[0])} - ${this.format_date(this.journey_data.main[this.journey_data.main.length-1].dateRange[0])}`;
|
||||
}catch{
|
||||
return '';
|
||||
return '?';
|
||||
}
|
||||
},
|
||||
update_date: function(idx){
|
||||
|
Loading…
x
Reference in New Issue
Block a user