Lunar phase styled

This commit is contained in:
2025-08-21 08:00:40 +00:00
parent 16b40c90d9
commit 0abec22e01
2 changed files with 11 additions and 15 deletions
+9 -8
View File
@@ -331,14 +331,8 @@ class InfiniteCalendar {
labelYear = cur.getFullYear()
}
const day = document.createElement('h1')
day.textContent = String(cur.getDate())
// lunar phase symbol (only for main phases)
const moon = document.createElement('span')
moon.className = 'lunar-phase'
moon.textContent = lunarPhaseSymbol(cur) || ''
if (moon.textContent) cell.appendChild(moon)
const day = document.createElement('h1')
day.textContent = String(cur.getDate())
const date = toLocalString(cur)
cell.dataset.date = date
@@ -386,6 +380,13 @@ class InfiniteCalendar {
}
cell.appendChild(day)
const luna = lunarPhaseSymbol(cur)
if (luna) {
const moon = document.createElement('span')
moon.className = 'lunar-phase'
moon.textContent = luna
cell.appendChild(moon)
}
daysGrid.appendChild(cell)
cur.setDate(cur.getDate() + 1)
}