-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.html
143 lines (129 loc) · 4.48 KB
/
tests.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>D'ni date converter</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/site.css" />
</head>
<body>
<div class="container">
<div id="main">
<h2>Date tests</h2>
<div class="row">
<div class="col-md-4">
<form>
<div class="form-group">
<label>Current date (local time)</label> <input class="form-control" type="text" readonly id="curDate" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>Current date (UTC)</label> <input class="form-control" type="text" readonly id="curDateUtc" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>Current D'ni date</label> <input class="form-control" type="text" readonly id="curDniDate" />
</div>
</form>
</div>
</div>
<hr />
<div class="row">
<div class="col-md-6">
<form>
<div class="form-group">
<label>Current date (Local time, back from current D'ni date above)</label> <input class="form-control" type="text" readonly id="curDateLocalConverted" />
</div>
</form>
</div>
<div class="col-md-6">
<form>
<div class="form-group">
<label>Current date (UTC, back from current D'ni date above)</label> <input class="form-control" type="text" readonly id="curDateUtcConverted" />
</div>
</form>
</div>
</div>
<hr />
<div class="row">
<div class="col-md-4">
<form>
<div class="form-group">
<label><br />DniDate(8, 4, 9) - Leevot 9, 8 DE 0:00:00:00</label> <input class="form-control" type="text" readonly id="fixedDniDateTest" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>D'ni date, from new DniDate(8, 4, 9) - September 27, 7649 BCE</label> <input class="form-control" type="text" readonly id="fixedDniDateTestSurfaceConverted" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>D'ni date with font mapping, from new DniDate(8, 4, 9) - September 27, 7649 BCE</label> <input class="form-control" type="text" readonly id="fixedDniDateTestFontMapping" />
</div>
</form>
</div>
</div>
<hr />
<div class="row">
<div class="col-md-4">
<form>
<div class="form-group">
<label>DniDate(9654, 0, 1) - Leefo 1, 9654 DE 0:00:00:00</label> <input class="form-control" type="text" readonly id="leefo1MidnightDni" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>DniDate(9654, 0, 1) - April 21, 1998 CE, 10:35:18 UTC</label> <input class="form-control" type="text" readonly id="leefo1MidnightSurfaceUtc" />
</div>
</form>
</div>
<div class="col-md-4">
<form>
<div class="form-group">
<label>DniDate(9654, 0, 1) - April 21, 1998 CE, Local time</label> <input class="form-control" type="text" readonly id="leefo1MidnightSurfaceLocal" />
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/DniDate.js"></script>
<script type="text/javascript">
var d = new Date();
$("#curDate").val(d.toString());
$("#curDateUtc").val(d.toUTCString());
var dd = new DniDate();
dd.setFromSurfaceDate(d);
$("#curDniDate").val(dd.toString());
var bd = dd.toSurfaceDate();
$("#curDateLocalConverted").val(bd.toString());
$("#curDateUtcConverted").val(bd.toUTCString());
var test5 = new DniDate(8, 4, 9);
$("#fixedDniDateTest").val(test5.toString());
var test6 = new DniDate(8, 4, 9);
$("#fixedDniDateTestSurfaceConverted").val(test6.toSurfaceDate().toUTCString());
var test7 = new DniDate(9654, 0, 1);
$("#leefo1MidnightDni").val(test7.toString());
var test8 = new DniDate(9654, 0, 1);
var test8Surface = test8.toSurfaceDate();
$("#leefo1MidnightSurfaceLocal").val(test8Surface.toString());
$("#leefo1MidnightSurfaceUtc").val(test8Surface.toUTCString());
var test9 = new DniDate(8, 4, 9);
$("#fixedDniDateTestFontMapping").val(test9.toFontMappedString());
</script>
</body>
</html>