-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (76 loc) · 2.65 KB
/
index.html
File metadata and controls
86 lines (76 loc) · 2.65 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>What Rust is it?</title>
<link href="https://code.cdn.mozilla.net/fonts/fira.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="me" href="https://social.berline.rs/@whatrustisit">
</head>
<body>
<a href="https://www.rust-lang.org/" class="brand">Rust</a>
<h1>What Rust is it?</h1>
<div id="flex-container">
<h2 id="stable" class="version">
<div class="vernum">1.94.0</div>
<div class="branch">Stable</div>
<div class="relnotes"><a href="https://github.com/rust-lang/rust/blob/1.94.0/RELEASES.md">Release notes</a></div>
</h2>
<h2 id="beta" class="version">
<div class="vernum">1.95.0-beta.2</div>
<div class="branch">Beta</div>
</h2>
<h2 id="nightly" class="version">
<div class="vernum">1.96.0 (2026-03-08)</div>
<div class="branch">Nightly</div>
</h2>
</div>
<h2 id="next-release">
<span>Next release day: Soon</span>
</h2>
<footer>
<p>
unofficial project
|
<a href="https://social.berline.rs/@whatrustisit" rel="me">@whatrustisit</a>
|
Rust Nightly logo by <a href="https://ura.design/">Ura Design</a>
|
<a href="https://github.com/badboy/whatrustisit">source code</a>
</p>
</footer>
<script type="text/javascript" src="dayjs.min.js"></script>
<script>
/* from https://github.com/rust-lang/rust-forge/blob/f13e6b49e117ec84179cb969efc94894ceaa8325/js/index.js */
function release() {
// Rust 1.5.0 was released on 2015-12-10
const EPOCH_DATE = dayjs.utc('2015-12-10')
const EPOCH_RELEASE = 5
const now = dayjs.utc()
console.log({now: now.format('YYYY-MM-DD')});
const newReleases = Math.floor(now.diff(EPOCH_DATE, 'weeks') / 6)
const currentRelease = EPOCH_DATE.clone().add(newReleases * 6, 'weeks')
const releaseDate = EPOCH_DATE.clone().add((newReleases+1) * 6, 'weeks')
const currentDiff = currentRelease.diff(now, 'days')
if (currentDiff == 0) {
return "<span>Next release day: TODAY</span>"
}
const nextDate = releaseDate.format('YYYY-MM-DD')
console.log({nextDate});
let diffDays = releaseDate.diff(now, 'days')
let dayWord = "days";
if (diffDays == 0) {
diffDays = 1
}
if (diffDays == 1) {
dayWord = "day"
}
let toWrite = "";
toWrite += "<span>Next release day: " + nextDate + "</span>";
toWrite += " <span>(in "+ diffDays + " " + dayWord + ")</span>"
return toWrite;
}
document.getElementById('next-release').innerHTML = release();
</script>
</body>
</html>