This commit is contained in:
@ -8,6 +8,17 @@ const gen_id = (length)=>{
|
||||
return result;
|
||||
}
|
||||
|
||||
Date.prototype.toJSONLocal = (function() {
|
||||
function addZ(n) {
|
||||
return (n<10? '0' : '') + n;
|
||||
}
|
||||
return function() {
|
||||
return this.getFullYear() + '-' +
|
||||
addZ(this.getMonth() + 1) + '-' +
|
||||
addZ(this.getDate());
|
||||
};
|
||||
}())
|
||||
|
||||
const query_nominatim = (q,f)=>{
|
||||
const ENDPOINT = '/api/place/'+q;
|
||||
return axios.get(ENDPOINT).then(res=>res.data).then(res=>res.filter(f));
|
||||
@ -89,6 +100,12 @@ const app = new Vue({
|
||||
query:{hotel:[],flight:[],nominatim:[]},
|
||||
querying:{hotel:false,flight:false,place:false,food:false},
|
||||
impexp:"",
|
||||
lang: {
|
||||
formatLocale: {
|
||||
firstDayOfWeek: 1,
|
||||
},
|
||||
monthBeforeYear: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
start_journey: function(event){
|
||||
@ -179,7 +196,7 @@ const app = new Vue({
|
||||
return this.format_date(date)
|
||||
},
|
||||
format_date: function(d){
|
||||
var dt = d.toJSON().slice(0, 10);
|
||||
var dt = d.toJSONLocal().slice(0, 10);
|
||||
return dt.slice(8, 10) + '/'
|
||||
+ dt.slice(5, 7) + '/'
|
||||
+ dt.slice(0, 4) + ' ('
|
||||
|
Reference in New Issue
Block a user