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:
@@ -3,7 +3,7 @@
|
||||
|
||||
import * as map from './map.js'
|
||||
import * as dt from './datetime.js'
|
||||
import {loadAll, showChart} from './showcharts.js'
|
||||
import {loadAll, showChart, setNoUTC} from './showcharts.js'
|
||||
import { DateTime } from './luxon.min.js'
|
||||
import {setCurrentTab, getCurrentTab, showError, fetchfromserver} from "./chart_utilities.js";
|
||||
|
||||
@@ -14,7 +14,7 @@ import {setCurrentTab, getCurrentTab, showError, fetchfromserver} from "./chart_
|
||||
// END global constants
|
||||
|
||||
// global variables
|
||||
let params = { // set defaults
|
||||
const params = { // set defaults
|
||||
center: Stuttgart,
|
||||
zoom: 10,
|
||||
span: 1,
|
||||
@@ -125,6 +125,8 @@ import {setCurrentTab, getCurrentTab, showError, fetchfromserver} from "./chart_
|
||||
// show the map if called w/o any parameter
|
||||
// if called with a sensor-ID, show the live chart for this sensor
|
||||
async function main() {
|
||||
setNoUTC() // no UTC for HighCharts
|
||||
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
|
||||
// set correct language
|
||||
const currentLang = localStorage.getItem('curlang')
|
||||
if(currentLang === 'en') {
|
||||
|
||||
Reference in New Issue
Block a user