Skip to content

Commit a883a60

Browse files
committed
mentors.html: Change mentor page year dynamically
Have the year on the GSoC mentor page change dynamically based on the current month. If it's past September, the page will show the next year, otherwise it will show the current year. Closes #706
1 parent fa09436 commit a883a60

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

partials/tabs/mentors.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="col m8 offset-m2">
55
<h1 class="fine center">Hello there!</h1>
66
<h4 class="light center">
7-
We are the mentors for coala in GSoC 2018.
7+
We are the mentors for coala in GSoC {{ getGsocYear() }}.
88
</h4>
99
<h4 class="light center">
1010
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a> -
@@ -42,7 +42,7 @@ <h4 class="light center">
4242
<div class="col m8 offset-m2">
4343
<h1 class="fine center">Admins</h1>
4444
<h4 class="light center">
45-
We are the admins for coala in GSoC 2018.
45+
We are the admins for coala in GSoC {{ getGsocYear() }}.
4646
</h4>
4747
<h4 class="light center">
4848
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a>

resources/js/app.js

+10
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,16 @@
386386
self.mentorsList = {}
387387
self.adminsList = {}
388388

389+
$scope.getGsocYear = function() {
390+
var gsocSwitchMonth = 6;
391+
var currentdate = new Date();
392+
if (currentdate.getMonth() >= gsocSwitchMonth) {
393+
return currentdate.getFullYear() + 1;
394+
} else {
395+
return currentdate.getFullYear();
396+
}
397+
}
398+
389399
$http.get('data/projects.liquid')
390400
.then(function (res) {
391401
$scope.projects = res.data.filter(project => project.status != "completed")

0 commit comments

Comments
 (0)