Skip to content

Commit

Permalink
functionality for change reserved days in celendar
Browse files Browse the repository at this point in the history
  • Loading branch information
ErfiDev committed Dec 10, 2021
1 parent 92a9cbe commit 4ebf98a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,8 @@ body {
}
.celendar-child {
border: 2px black solid;
}

.celendar-reserved {
background-color: rgb(2, 184, 2);
}
13 changes: 13 additions & 0 deletions views/admin-res-celendar.page.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,18 @@
}

InitCelendar();

function InitColors(daysArr) {
let allChilds = document.querySelectorAll(".celendar-child");
for (let x in daysArr) {
for (let child in allChilds) {
if (allChilds[child].innerText === daysArr[x]) {
allChilds[child].classList.add("celendar-reserved");
}
}
}
}

InitColors({{index .Data "times"}})
</script>
{{end}}

0 comments on commit 4ebf98a

Please sign in to comment.