This commit is contained in:
Peter Maquiran
2023-08-28 17:32:11 +01:00
38 changed files with 109 additions and 89 deletions
+22 -19
View File
@@ -291,34 +291,37 @@ export class AgendaPage implements OnInit {
}, 1000)
}
weeksToShow = []
height = '75px'
weekToShow() {
setTimeout(() => {
let num = 0;
try {
let weekNum = 0;
function Week(a) {
for(let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) {
num++;
return true
function Week(a) {
for(let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) {
weekNum++;
return true
}
}
}
}
for (let a of document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr') as any ){
Week(a)
}
if(num <= 5) {
this.weeksToShow = ["week-5"]
} else {
this.weeksToShow = ["week-6"]
}
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
for (let week of weeks as any ){
Week(week)
}
this.showCalendar = true
this.height = (weekNum * dayBoxHeight) +'px'
} catch (e) {
setTimeout(()=> {
this.weekToShow()
}, 100)
}
}, 250)
}