a596ee557e
public/javascripts/chart_utilities.js
- add address in #addSensorID'
- function 'addAddress' added
public/javascripts/datetime.js
- removed unnecessary comment
public/javascripts/global.js
- refreshrate changed to 5 min
- typo 'autohide' corrected
views/index.pug
- removed text 'only for live ...'
views/layout.pug
- removed superflous links and variables
public/javascripts/maps.js
- added address to marker popup
charts/preparecharts.js
- translate legend texts
public/javascripts/showcharts.js
- dont show selected tab
public/stylesheets/style.sass
- add style for sensornumber on chart
loclae/[de|en]/translation.json
- added translations for legend
charts/utilities.js
- ymax for live set to 120
31 lines
1002 B
JavaScript
31 lines
1002 B
JavaScript
// 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')
|
|
}
|