Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions assets/js/registration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const registrationController = (function(jQuery) {
const CLASS_HIDDEN = 'd-none';
const MENTORSHIP_OPEN_MONTH = 3; //March
const MENTORSHIP_CLOSE_MONTH = 11; //November
const MENTORSHIP_ADHOC_OPEN_MONTH = 5; //May
const MENTORSHIP_ADHOC_CLOSE_MONTH = 11; //November

const checkAdHocSessions = function() {
jQuery('.card-mentor').each(function() {
Expand All @@ -17,12 +17,12 @@ const registrationController = (function(jQuery) {
const currentDay = currentDate.getDate();
const currentMonth = currentDate.getMonth() + 1;

const isMentorshipCycle = (
currentMonth >= MENTORSHIP_OPEN_MONTH &&
currentMonth <= MENTORSHIP_CLOSE_MONTH
const isAdhocMentorshipCycle = (
currentMonth >= MENTORSHIP_ADHOC_OPEN_MONTH &&
currentMonth <= MENTORSHIP_ADHOC_CLOSE_MONTH
);

if (currentDay <= daysOpen && isMentorshipCycle) {
if (currentDay <= daysOpen && isAdhocMentorshipCycle) {
if (mentorType !== 'long-term') {
if (mentorAvailability.includes(currentMonth.toString())) {
jQuery(`#registration-link-${mentorIndex}`).removeClass(CLASS_HIDDEN);
Expand Down