diff --git a/public/js/main.js b/public/js/main.js index 0bf48b4..e8725b8 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -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) + ' (' diff --git a/public/template/home.html b/public/template/home.html index c657521..9161456 100644 --- a/public/template/home.html +++ b/public/template/home.html @@ -8,20 +8,8 @@ - - - - - - - - - - - - @@ -121,6 +109,15 @@ + + + + + + + + +