Added global range and daycount
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir 2023-07-19 09:23:30 +02:00
parent 6250f17207
commit 36c21b840a
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
2 changed files with 13 additions and 3 deletions

View File

@ -197,6 +197,15 @@ const app = new Vue({
+ d.getDate() + ' '
+ ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][d.getMonth()];
},
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)
},
total_date: function(){
if(this.journey_data.main.length==0) return '';
return `${this.format_date(this.journey_data.main[this.journey_data.main.length-1].dateRange[0])} - ${this.format_date(this.journey_data.main[0].dateRange[0])}`;
},
update_date: function(idx){
let dateRange = this.journey_data.main[idx].dateRange;
let start_end = [0,0];

View File

@ -2,9 +2,10 @@ header.header
.header-inner.container
a.header-logo.text-dark(href='/')
img.header-logoImage(src='/public/img/helcel.png' alt='Helcel logo' width='40')
span.hide-small HOTM
.input.input-invis
input.small(v-model='journey_data.name' type='text')
span.hide-small OTM
.input.input-invis.row
input.col-6.small(v-model='journey_data.name' type='text')
input.col-6.small(disabled type='text' :placeholder='total_date() + " (" + total_days() + ")"')
.row.header-nav.text-big(style='margin-bottom: 0;')
.col-sm-2
a(:href="'/short/'+journey_id")