Datum-Anzeige gehtt mal soweit
Fehlt noch: - Monate obern drüber - Aufruf inischema wenn letzter Tag geklickt - ankreuzen noch testen
This commit is contained in:
@@ -8,7 +8,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
document.querySelector('#curmon').innerHTML = curdate.replace('_',' ')
|
||||
|
||||
|
||||
// initSchema('2023-05-01')
|
||||
initSchema('2023-05-01')
|
||||
|
||||
let ret = await getData()
|
||||
fillSchema(ret.data)
|
||||
@@ -40,9 +40,8 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
const setArray = data.data
|
||||
for(let i = 0; i < 35; i++) {
|
||||
let sel = '#bt'+(i+1)
|
||||
let day = DateTime.fromISO(setArray[i].day).toFormat('d')
|
||||
document.querySelector(sel).setAttribute('innerHTML', day)
|
||||
if (setArray[i].day !== '') {
|
||||
document.querySelector(sel).innerHTML = DateTime.fromISO(setArray[i].day).toFormat('d')
|
||||
if (setArray[i].status) {
|
||||
document.querySelector(sel).setAttribute('aria-label', 'x')
|
||||
document.querySelector(sel).setAttribute('disabled', 'disabled')
|
||||
@@ -81,13 +80,15 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
function initSchema(startdate) {
|
||||
let setArray = []
|
||||
let ld0 = DateTime.fromISO(startdate)
|
||||
let k = 0
|
||||
for(let i = 0; i < 35; i++) {
|
||||
let elem = {status: false}
|
||||
if (i === 17) {
|
||||
elem.day = ''
|
||||
} else {
|
||||
let ld = ld0.plus({day: i})
|
||||
let ld = ld0.plus({day: k})
|
||||
elem.day = ld.toFormat('y-LL-dd')
|
||||
k++
|
||||
}
|
||||
setArray.push(elem)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user