-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
321 lines (308 loc) · 15.9 KB
/
index.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html>
<html lang="en">
<head>
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-WLNSXRJT");
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calculate the number of days between two dates</title>
<meta
name="description"
content="Use this simple tool to calculate the number of days between two dates. Perfect for planning events, tracking deadlines, and more. Try it now!" />
<meta
name="keywords"
content="days between dates, date calculator, how many days, date difference, calculate days, time calculator, how many days till" />
<link rel="canonical" href="https://howmanydays.info/" />
<meta name="robots" content="index, follow" />
<meta property="og:title" content="Days Between Dates Calculator" />
<meta
property="og:description"
content="Calculate the number of days between two dates easily." />
<meta property="og:url" content="https://howmanydays.info/" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://howmanydays.info/logo.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Days Between Dates Calculator" />
<meta
name="twitter:description"
content="Calculate the number of days between two dates easily." />
<meta name="twitter:image" content="https://howmanydays.info/logo.png" />
<script type="module" crossorigin src="./src/main.ts"></script>
<link rel="stylesheet" crossorigin href="./src/style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap"
rel="stylesheet" />
<link
rel="icon"
type="image/png"
href="/favicon/favicon-96x96.png"
sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg" />
<link rel="shortcut icon" href="/favicon/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/favicon/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="MyWebSite" />
<link rel="manifest" href="/favicon/site.webmanifest" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Days Between Dates Calculator",
"url": "https://howmanydays.info",
"description": "A simple tool to calculate the number of days between two dates.",
"applicationCategory": "Utilities",
"operatingSystem": "All",
"browserRequirements": "Requires JavaScript",
"datePublished": "2024-12-05",
"inLanguage": "en"
}
</script>
</head>
<body class="bg-blue-50 min-h-screen flex flex-col">
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-WLNSXRJT"
height="0"
width="0"
style="display: none; visibility: hidden"></iframe
></noscript>
<div class="text-sm text-center h-10 flex items-center justify-center">
<span
>A website by
<a
target="_blank"
class="underline text-blue-400"
href="https://imdaniel.dev"
>Daniël</a
></span
>
<a
class="max-w-10 h-auto block mx-auto absolute right-0 top-0"
href="https://github.com/danielvandervelden"
target="_blank"
><img src="/github.webp"
/></a>
</div>
<main class="container mx-auto px-2 pb-2 flex-grow md:pb-4 md:px-4">
<section class="bg-white shadow-md rounded-lg p-2 mb-4 md:p-4">
<h1 class="sr-only">How Many Days Between Dates Calculator</h1>
<header class="text-2xl md:text-5xl text-center">
It is currently
<span id="date" class="font-bold block md:inline-block"></span>
</header>
<p class="my-3 text-center text-lg text-gray-700">
Welcome to "howmanydays"! This is a simple tool to calculate the
number of days since, or until, a given date.
</p>
</section>
<section class="bg-white shadow-md rounded-lg p-2 mb-4 md:p-4">
<h2 class="text-2xl text-center">Quickly check how many days:</h2>
<div class="flex justify-center mt-2">
<div class="rounded-md bg-blue-200 inline-flex">
<div class="relative">
<input
type="radio"
id="since-qc"
name="verb-qc"
value="since-qc"
class="absolute top-0 right-0 block w-full h-full opacity-0 peer quick-action-toggle" />
<label
for="since-qc"
class="rounded-l-md px-5 py-2 flex items-center peer-checked:bg-blue-600 peer-checked:text-white">
Since
</label>
</div>
<div class="relative">
<input
type="radio"
id="until-qc"
name="verb-qc"
value="until-qc"
class="absolute top-0 right-0 block w-full h-full opacity-0 peer quick-action-toggle"
checked />
<label
for="until-qc"
class="rounded-r-md px-5 py-2 flex items-center peer-checked:bg-blue-600 peer-checked:text-white">
Until
</label>
</div>
</div>
</div>
<div class="flex gap-2 overflow-auto mt-3 pb-5">
<!-- Christmas -->
<button
id="christmas"
data-date="12-25"
class="quick-action-button px-4 py-2 bg-red-600 text-white font-semibold rounded-md shadow-md hover:bg-red-700 focus:ring focus:ring-red-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Christmas
</button>
<!-- Halloween -->
<button
id="halloween"
data-date="10-31"
class="quick-action-button px-4 py-2 bg-orange-500 text-white font-semibold rounded-md shadow-md hover:bg-orange-600 focus:ring focus:ring-orange-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Halloween
</button>
<!-- Thanksgiving -->
<button
id="thanksgiving"
data-date="11-25"
class="quick-action-button px-4 py-2 bg-amber-500 text-white font-semibold rounded-md shadow-md hover:bg-amber-600 focus:ring focus:ring-amber-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Thanksgiving
</button>
<!-- New Year -->
<button
id="new-year"
data-date="01-01"
class="quick-action-button px-4 py-2 bg-green-500 text-white font-semibold rounded-md shadow-md hover:bg-green-600 focus:ring focus:ring-green-300 whitespace-nowrap">
<span class="qc-verb-text"></span> New Year
</button>
<!-- Easter -->
<button
id="easter"
data-date="04-04"
class="quick-action-button px-4 py-2 bg-pink-500 text-white font-semibold rounded-md shadow-md hover:bg-pink-600 focus:ring focus:ring-pink-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Easter
</button>
<!-- Valentine's Day -->
<button
id="valentines"
data-date="02-14"
class="quick-action-button px-4 py-2 bg-red-500 text-white font-semibold rounded-md shadow-md hover:bg-red-600 focus:ring focus:ring-red-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Valentine's
</button>
<!-- Summer -->
<button
id="summer"
data-date="06-21"
class="quick-action-button px-4 py-2 bg-yellow-500 text-black font-semibold rounded-md shadow-md hover:bg-yellow-600 focus:ring focus:ring-yellow-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Summer
</button>
<!-- Winter -->
<button
id="winter"
data-date="12-21"
class="quick-action-button px-4 py-2 bg-blue-500 text-white font-semibold rounded-md shadow-md hover:bg-blue-600 focus:ring focus:ring-blue-300 whitespace-nowrap">
<span class="qc-verb-text"></span> Winter
</button>
<!-- Autumn -->
<button
id="autumn"
data-date="09-22"
class="quick-action-button px-4 py-2 bg-orange-400 text-white font-semibold rounded-md shadow-md hover:bg-orange-500 focus:ring focus:ring-orange-200 whitespace-nowrap">
<span class="qc-verb-text"></span> Autumn
</button>
<!-- Spring -->
<button
id="spring"
data-date="03-20"
class="quick-action-button px-4 py-2 bg-green-400 text-white font-semibold rounded-md shadow-md hover:bg-green-500 focus:ring focus:ring-green-200 whitespace-nowrap">
<span class="qc-verb-text"></span> Spring
</button>
</div>
</section>
<section class="bg-white shadow-md rounded-lg pt-2 pb-4 mb-4 md:p-4">
<p class="text-lg font-medium text-gray-700 text-center">
Do you want to use the current date or a custom date?
</p>
<div class="flex justify-center mt-5">
<div class="rounded-md bg-blue-200 inline-flex">
<div class="relative">
<input
type="radio"
id="now"
name="date"
value="now"
class="absolute cursor-pointer top-0 right-0 block w-full h-full opacity-0 peer date-radio"
checked />
<label
for="now"
class="rounded-l-md px-5 py-2 flex items-center peer-checked:bg-blue-600 peer-checked:text-white peer-hover:bg-blue-300 transition-all">
Current date
</label>
</div>
<div class="relative">
<input
type="radio"
id="other"
name="date"
value="other"
class="absolute cursor-pointer top-0 right-0 block w-full h-full opacity-0 peer date-radio" />
<label
for="other"
class="rounded-r-md px-5 py-2 flex items-center peer-checked:bg-blue-600 peer-checked:text-white peer-hover:bg-blue-300 transition-all">
Other
</label>
</div>
</div>
</div>
<div class="mt-5 hidden text-center" id="current-date-wrapper">
<input type="date" id="current-date" class="border rounded-md p-2" />
</div>
</section>
<section class="bg-white shadow-md rounded-lg pt-2 pb-4 mb-4 md:p-4">
<div class="flex flex-col md:flex-row justify-center items-center gap-4">
<span class="text-lg font-medium text-gray-700">How many days</span>
<div class="rounded-md bg-zinc-200 inline-flex">
<div class="relative">
<input
type="radio"
id="since"
name="verb"
value="since"
class="absolute top-0 right-0 block w-full h-full opacity-0 peer verb-radio pointer-events-none"
checked />
<label
for="since"
class="rounded-l-md px-5 py-2 flex items-center peer-checked:bg-zinc-600 peer-checked:text-white">
Since
</label>
</div>
<div class="relative">
<input
type="radio"
id="to"
name="verb"
value="until"
class="absolute top-0 right-0 block w-full h-full opacity-0 peer verb-radio pointer-events-none" />
<label
for="to"
class="rounded-r-md px-5 py-2 flex items-center peer-checked:bg-zinc-600 peer-checked:text-white">
Until
</label>
</div>
</div>
<div>
<input
type="date"
value="2024-06-29"
id="target-date"
class="border rounded-md p-2" />
</div>
</div>
</section>
<section class="bg-white shadow-md rounded-lg p-6">
<div class="text-center">
<div
class="text-2xl md:text-7xl font-bold text-blue-600"
id="result"></div>
<div class="text-red-600" id="error"></div>
</div>
</section>
</main>
</body>
</html>