Repository navigation
Expand file tree
/
Copy pathdate-time.html
More file actions
68 lines (64 loc) · 1.97 KB
/
Copy pathdate-time.html
File metadata and controls
68 lines (64 loc) · 1.97 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
<!doctype html>
<html lang="en-US" style="height: 100%">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="sig-nal date-time demo" />
<title>sig-nal | date-time demo</title>
<script type="module" src="./dist/index.js"></script>
</head>
<body>
<digital-clock>
<template shadowrootmode="open">
<style>
* {
font-family: system-ui;
font-weight: 700;
font-size: 26px;
}
table {
background: #555;
color: #fff;
padding: 0 5px;
border-radius: 5px;
}
td {
min-width: 36px;
}
.year {
min-width: 72px;
}
.weekday:after {
content: ',';
}
.day:after {
content: '.';
}
.hour:after,
.minute:after {
content: ':';
margin-right: -2px;
}
</style>
<table>
<tr>
<td id="datetime0" class="weekday">Freitag</td>
<td id="datetime2" class="day">10</td>
<td id="datetime4" class="month">October</td>
<td id="datetime6" class="year">2025</td>
<td id="datetime8" class="hour">22</td>
<td id="datetime10" class="minute">15</td>
<td id="datetime12">15</td>
<td id="datetime14">MESZ</td>
</tr>
</table>
<!-- prettier-ignore -->
<sig-nal new="datetime" for="previousElementSibling" hydrate>
{"": {"@init": ({signal}) => setInterval(() => (signal.value = Intl.DateTimeFormat('de-CH', { dateStyle: 'full', timeStyle: 'long'}).formatToParts(Date.now()).map(({value}) => ({textContent: value}))), 1000),
".firstElementChild": renderWith(object, false)
}
}
</sig-nal>
</template>
</digital-clock>
</body>
</html>