diff --git a/public/js/main.js b/public/js/main.js index 1977f0d..7c2ce3f 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -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]; diff --git a/template/module/nav.pug b/template/module/nav.pug index 8c06f85..b346eae 100644 --- a/template/module/nav.pug +++ b/template/module/nav.pug @@ -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")