Skip to content

Commit

Permalink
feat: hidden btn
Browse files Browse the repository at this point in the history
  • Loading branch information
RezenkovD committed Aug 15, 2023
1 parent 5b40e5e commit 2e428c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vr_club_site/templates/site/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div id="prevMonthBtn" class="name-month"></div>
</div>
<div class="month" id="month"></div>
<div class="button-m item3">
<div id="nextMonth" class="button-m item3">
<div id="nextMonthBtn" class="name-month"></div>
<svg class="caret-right" width="32" height="32" viewBox="0 0 32 32" fill="none"
xmlns="http://www.w3.org/2000/svg">
Expand Down
13 changes: 13 additions & 0 deletions vr_club_site/templates/site/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ document.addEventListener("DOMContentLoaded", function () {
prevMonth_.style.cursor = "pointer"
}

const nextMonth_ = document.getElementById("nextMonth");
const currentDate = new Date(currentYear, currentMonth);
const maxAllowedDate = new Date();
maxAllowedDate.setMonth(maxAllowedDate.getMonth() + maxMonthsAhead - 1);

if (currentDate > maxAllowedDate) {
nextMonth_.style.opacity = 0;
nextMonth_.style.cursor = "default"
} else {
nextMonth_.style.opacity = 1;
nextMonth_.style.cursor = "pointer"
}

}

function updateCalendar() {
Expand Down

0 comments on commit 2e428c1

Please sign in to comment.