Using and showing always local time

routes/api.js
   - console.log deleted

public/javascripts/global.js
   - made 'params' to const
   - added setNoUTC in main

public/javascripts/showcharts.js
   - added setNiUTC to set global at highcharts

package.json
   - added luxon
     "version": "3.0.4",
     "date": "2023-04-24 18:00 UTC",
This commit is contained in:
rxf
2023-05-24 19:45:12 +02:00
parent 4cea325f56
commit 3921a889a2
6 changed files with 85 additions and 48 deletions
+9 -1
View File
@@ -19,7 +19,7 @@ export async function showChart(params, typ, container) {
function form() {
for (let item of tabtable) {
if (item.type === typ) {
const d = DateTime.fromMillis(this.x, {zone: 'utc'})
const d = DateTime.fromMillis(this.x)
const d1 = d.plus({days: 1})
let fmt = d.toFormat(item.dformat)
if (((typ === 'daynight') && (this.series.name.startsWith('N'))) || (typ === 'lden')) {
@@ -112,3 +112,11 @@ export const loadAll = async (params, start = 2) => {
}
}
}
export const setNoUTC = () => {
Highcharts.setOptions({
global: {
useUTC: false // Don't use UTC on the charts
}
});
}