-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·99 lines (88 loc) · 4.05 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Date Format Selector</title>
<!-- Links to local files -->
<link rel="stylesheet" href="./styles.css">
<script src="./radio-group.js" defer></script>
<script src="./main.js" defer></script>
</head>
<body>
<h1 class="mainHeader">Date Format Selector</h1>
<p class="intro">
This is a small utility application that will let you easily configure options for the
<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString">Date.toLocaleString()</a> function.
Please consult <a href="./README.md" target="_blank">the README</a>
(also hosted <a target="_blank" href="https://github.com/nicholas-wilcox/date-format-selector/blob/main/README.md">on GitHub</a>)
for information on how to use it.
</p>
<div id="dateHeader">
<form id="inputDateForm">
<!-- Date input -->
<div>
<label for="dateInput">Date:</label>
<input type="datetime-local" step="1" id="dateInput" name="dateInput">
</div>
<!-- Current time toggle -->
<div>
<input type="checkbox" id="useNow" name="useNow">
<label for="useNow">Use Current Time</label>
</div>
</form>
<!-- Locales and time zone inputs -->
<div id="localesAndTimeZone">
<label for="localesInput">Locales:</label>
<input type="text" id="localesInput" name="localesInput">
<label for="timeZoneInput">Time Zone:</label>
<input type="text" id="timeZoneInput" name="timeZoneInput">
</div>
<span id="output"></span>
</div>
<!-- Style and formatting options -->
<form id="formatOptionsForm">
<fieldset id="styleOptions" class="optionSet">
<legend>Style Options</legend>
<radio-group name="dateStyle" data-values="short,medium,long,full"></radio-group>
<radio-group name="timeStyle" data-values="short,medium,long,full"></radio-group>
</fieldset>
<fieldset id="dateOptions" class="optionSet">
<legend>Date Options</legend>
<radio-group name="weekday" data-values="narrow,short,long"></radio-group>
<radio-group name="era" data-values="narrow,short,long"></radio-group>
<radio-group name="year" data-values="2-digit,numeric"></radio-group>
<radio-group name="month" data-values="2-digit,numeric,narrow,short,long"></radio-group>
<radio-group name="day" data-values="2-digit,numeric"></radio-group>
</fieldset>
<fieldset id="timeOptions" class="optionSet">
<legend>Time Options</legend>
<radio-group name="dayPeriod" data-values="narrow,short,long"></radio-group>
<radio-group name="hour" data-values="2-digit,numeric"></radio-group>
<radio-group name="minute" data-values="2-digit,numeric"></radio-group>
<radio-group name="second" data-values="2-digit,numeric"></radio-group>
<radio-group name="fractionalSecondDigits" data-values="1,2,3"></radio-group>
<radio-group name="timeZoneName" data-values="short,long,shortOffset,longOffset,shortGeneric,longGeneric"></radio-group>
</fieldset>
</form>
<footer>
Made with 💖 by Nick @ <a href="https://linicks.dev" target="_blank">linicks.dev</a>.
</footer>
<!-- Template for a radio group, expects to contain copies of the radio-input-template -->
<template id="radio-group-template">
<!-- These styles must be declared here because it will be inside of the <radio-group>'s shadow root. -->
<link href="./radio-group.styles.css" rel="stylesheet">
<div>
<h3 id="header"></h3>
<button id="clearButton">Clear</button>
</div>
</template>
<!-- Template for an individual radio selector -->
<template id="radio-input-template">
<label class="radio-input-container">
<input type="radio">
<span class="radio-label"><span>
</label>
</template>
</body>
</html>