Update index.html
Browse files- index.html +7 -5
index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<title>
|
| 6 |
<style>
|
| 7 |
body { font-family: sans-serif; padding: 20px; }
|
| 8 |
ul { list-style-type: none; padding: 0; }
|
|
@@ -14,17 +14,19 @@
|
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
|
| 17 |
-
<ul id="birthday-list">
|
| 18 |
-
<!-- Populated by script -->
|
| 19 |
-
</ul>
|
| 20 |
|
| 21 |
<script>
|
| 22 |
const offsets = [8, 15, 30];
|
| 23 |
const ages = [22, 25, 30];
|
| 24 |
const ul = document.getElementById("birthday-list");
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
offsets.forEach(offset => {
|
| 27 |
-
const date = new Date();
|
| 28 |
date.setDate(date.getDate() + offset);
|
| 29 |
|
| 30 |
const month = date.toLocaleString('default', { month: 'short' });
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<title>Upcoming Birthdays</title>
|
| 6 |
<style>
|
| 7 |
body { font-family: sans-serif; padding: 20px; }
|
| 8 |
ul { list-style-type: none; padding: 0; }
|
|
|
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
|
| 17 |
+
<ul id="birthday-list"></ul>
|
|
|
|
|
|
|
| 18 |
|
| 19 |
<script>
|
| 20 |
const offsets = [8, 15, 30];
|
| 21 |
const ages = [22, 25, 30];
|
| 22 |
const ul = document.getElementById("birthday-list");
|
| 23 |
|
| 24 |
+
// Start from tomorrow
|
| 25 |
+
const tomorrow = new Date();
|
| 26 |
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
| 27 |
+
|
| 28 |
offsets.forEach(offset => {
|
| 29 |
+
const date = new Date(tomorrow);
|
| 30 |
date.setDate(date.getDate() + offset);
|
| 31 |
|
| 32 |
const month = date.toLocaleString('default', { month: 'short' });
|