5fb78d4eb5
public/javascripts/datetime.js - wrong call fixed public/javascripts/global.js - direct call to live chart if sensorid is given public/javascripts/showcharts.js - info table added public/stylesheets/style.sass - style for infotabel - changed color vor nav tabs
20 lines
516 B
JavaScript
20 lines
516 B
JavaScript
// all date and time functions
|
|
import { DateTime } from './luxon.min.js'
|
|
|
|
// Show date and time (every minute)
|
|
export const showDate = (sofort) => {
|
|
let d = DateTime.now()
|
|
if(sofort || d.second === 0) {
|
|
document.querySelector('#h1datum').innerHTML = d.toFormat('yyyy-MM-dd HH:mm')
|
|
}
|
|
|
|
}
|
|
|
|
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')
|
|
}
|