-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathcheckin-schedule.html
106 lines (98 loc) · 3.9 KB
/
checkin-schedule.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<div>
<div style="margin-bottom: 1em">
<span style="color: #878787; display: block" id="previous-week-date"></span>
<span id="previous-week-name"></span>
</div>
<div style="font-size: 1.2em; margin-bottom: 1em">
<span style="color: #878787; display: block" id="this-week-date"></span>
<span id="this-week-name"></span>
</div>
<div style="margin-bottom: 1em">
<span style="color: #878787; display: block" id="next-week-date"></span>
<span id="next-week-name"></span>
</div>
</div>
<script>
var today = new Date();
var year = new Date(today.getFullYear(), 0, 1);
var week = Math.floor(((today - year) / 86400000) / 7) + 1;
// This is a hack to not mess the checkins order when we change the amount
// of working groups.
// Increment this number by one when you realize that after adding
// working groups the website checkins order messes.
var magic_number = 4;
// Add new working groups on the end of the list.
// When adding/removing working groups adjust magic number to match the
// current order we see on the page.
var wgs = [
{
name: "Async Foundations",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-async-foundations.toml"
},
{
name: "Traits",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-traits.toml"
},
{
name: "Diagnostics",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-diagnostics.toml"
},
{
name: "Rustc Dev Guide",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-rustc-dev-guide.toml"
},
{
name: "Incremental Compilation",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-incr-comp.toml"
},
{
name: "LLVM",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-llvm.toml"
},
{
name: "MIR Optimizations",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-mir-opt.toml"
},
{
name: "Polymorphization",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-polymorphization.toml"
},
{
name: "RLS 2.0",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-rls-2.toml"
},
{
name: "Self-Profile",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-self-profile.toml"
},
{
name: "Debugging",
url: "https://github.com/rust-lang/team/blob/master/teams/wg-debugging.toml"
}
];
var count = wgs.length % 2 === 0 ? wgs.length : wgs.length + 1;
function getDateFromWeek(week, year) {
var day = (2 + (week - 1) * 7);
return new Date(Date.UTC(year, 0, day));
}
function getDateString(date) {
return date.toISOString().substring(0, 10);
}
function updateElementForWeek(week, element, name) {
var i = (week + magic_number) * 2 % count;
var message;
if ((typeof wgs[i + 1]) !== "undefined") {
message = `<a href="${wgs[i].url}" target="_blank">${wgs[i].name}</a> and <a href="${wgs[i + 1].url}" target="_blank">${wgs[i + 1].name}</a>`;
} else {
message = `<a href="${wgs[i].url}" target="_blank">${wgs[i].name}</a>`;
}
document.getElementById(element + "-name").innerHTML = message;
document.getElementById(element + "-date").innerHTML =
name + ": " +
getDateString(getDateFromWeek(week, today.getFullYear())) + " - " +
getDateString(getDateFromWeek(week + 1, today.getFullYear()));
}
updateElementForWeek(week + 1, "next-week", "Next Week");
updateElementForWeek(week, "this-week", "This Week");
updateElementForWeek(week - 1, "previous-week", "Previous Week");
</script>