// all date and time functions import { DateTime } from './luxon.min.js' import {loadAll, showChart, setNoUTC} from './showcharts.js' import {getCurrentTab} from "./chart_utilities.js"; // Show date and time (every minute) // Will be called every second export const showDate = (sofort, params) => { let d = DateTime.now() if(sofort || d.second === 0) { document.querySelector('#h1datum').innerHTML = d.toFormat('yyyy-MM-dd HH:mm') } if (((d.minute % params.refreshRate) == 0) && (d.second == 15)) { // alle ganzen refreshRate Minuten, 15sec danach let start = 1 console.log(params.refreshRate, 'Minuten um, Grafik wird erneuert'); let ct = getCurrentTab() if (ct !== 'maptab') { loadAll(params, start) } } } export const formatJSDate = (d) => { return DateTime.fromJSDate(d).toFormat('yyyy-LL-dd HH:mm:ss') } export const formatISODate = (d) => { return DateTime.fromISO(d).toFormat('yyyy-LL-dd HH:mm:ss') }