Einheiten dazu
routes/index.js - Übergabe der Einheiten views/leayout.pug - Übernahme der Einheiten package.json "version": "1.1.0", "date": "2023-05-14", public/javascript/script.js - glob. Variable für Einheiten - Einheiten einlesen bei Click - Anzeige der Einheiten - bei init Einheiten auf 0 public/stylesheets/style.css - Anpassungen wg. Einheiten
This commit is contained in:
@@ -2,8 +2,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
|
||||
const DateTime = luxon.DateTime
|
||||
|
||||
const DEFEINHEIT = 8
|
||||
let curEinheit = 0
|
||||
let curEinheit = sysParams.einheit
|
||||
|
||||
if (sysParams.doinit) {
|
||||
await initSchema('2023-05-01')
|
||||
@@ -22,7 +21,9 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
field.setAttribute('aria-label','x');
|
||||
field.setAttribute('disabled','disabled');
|
||||
schema.data[parseInt(field.id.slice(2))-1].status = true
|
||||
schema.data[parseInt(field.id.slice(2))-1].einheit = curEinheit
|
||||
await storeData(schema)
|
||||
fillSchema(schema)
|
||||
if (e.srcElement.id === 'bt35') {
|
||||
let ldt = DateTime.fromISO(d)
|
||||
ldt = ldt.plus({day: 1})
|
||||
@@ -32,16 +33,14 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
|
||||
async function enterEinheit (e) {
|
||||
let field = e.target;
|
||||
let d = schema.data[34].day
|
||||
schema.data[parseInt(field.id.slice(2))-1].einheit = field.value
|
||||
await storeData(schema)
|
||||
curEinheit = field.value
|
||||
}
|
||||
|
||||
function buildCellHtml(day, einheit) {
|
||||
let x = `${day.toFormat('d')}
|
||||
<div id="lowline" class="small">
|
||||
<div>${day.setLocale('de').toFormat('ccc')}</div>
|
||||
<div>${einheit !== 0 ? einheit : ''}</div>
|
||||
<div id="eh">${einheit !== 0 ? einheit : ''}</div>
|
||||
</div>`
|
||||
return x
|
||||
}
|
||||
@@ -105,7 +104,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
let k = 0
|
||||
for(let i = 0; i < 35; i++) {
|
||||
let elem = {status: false}
|
||||
elem.einheit = curEinheit
|
||||
elem.einheit = 0
|
||||
if (i === 17) {
|
||||
elem.day = ''
|
||||
} else {
|
||||
|
||||
@@ -74,3 +74,7 @@ footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#eh {
|
||||
color: black;
|
||||
}
|
||||
Reference in New Issue
Block a user