Lunar phase styled
This commit is contained in:
+9
-8
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user