fix timezone
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-04 14:43:00 +02:00
parent 45f31e360c
commit 97dba4cd01
3 changed files with 28 additions and 15 deletions

View File

@ -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) + ' ('