Skip to content

Commit

Permalink
mentors.html: Change mentor page year dynamically
Browse files Browse the repository at this point in the history
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 coala#706
  • Loading branch information
aedorado committed Feb 5, 2019
1 parent fa09436 commit a883a60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions partials/tabs/mentors.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="col m8 offset-m2">
<h1 class="fine center">Hello there!</h1>
<h4 class="light center">
We are the mentors for coala in GSoC 2018.
We are the mentors for coala in GSoC {{ getGsocYear() }}.
</h4>
<h4 class="light center">
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a> -
Expand Down Expand Up @@ -42,7 +42,7 @@ <h4 class="light center">
<div class="col m8 offset-m2">
<h1 class="fine center">Admins</h1>
<h4 class="light center">
We are the admins for coala in GSoC 2018.
We are the admins for coala in GSoC {{ getGsocYear() }}.
</h4>
<h4 class="light center">
Just drop a message on <a href="https://coala.io/chat" class="bear-link">Gitter</a>
Expand Down
10 changes: 10 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,16 @@
self.mentorsList = {}
self.adminsList = {}

$scope.getGsocYear = function() {
var gsocSwitchMonth = 6;
var currentdate = new Date();
if (currentdate.getMonth() >= gsocSwitchMonth) {
return currentdate.getFullYear() + 1;
} else {
return currentdate.getFullYear();
}
}

$http.get('data/projects.liquid')
.then(function (res) {
$scope.projects = res.data.filter(project => project.status != "completed")
Expand Down

0 comments on commit a883a60

Please sign in to comment.