-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·71 lines (58 loc) · 2.42 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
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<!-- JQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- JQuery UI -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<!-- DateJs -->
<script src="js/date.js"></script>
<script>
$(function() {
$( "#input-date" ).datepicker({
showButtonPanel: true
});
});
function goButtonOnClick() {
$( "#results" ).show();
// Use DateJs to parse the input date and calculate the output date
var inputDate = Date.parse(
$( "#input-date" ).val()
);
// It is necessary to clone inputDate because addDays alters inputDate
var outputDate = inputDate.clone().addDays(150);
// Use DateJs to create a nice presentation of the dates
var dateFormat = "dddd, MMMM d, yyyy";
var formattedInputDate = inputDate.toString(dateFormat);
var formattedOutputDate = outputDate.toString(dateFormat);
// Display the dates on the page
$( "#result-label-inputdate" ).html(formattedInputDate);
$( "#result-150" ).html(formattedOutputDate);
}
</script>
</head>
<body>
<div id="input">
<form>
<input type="text" id="input-date" value="Pick a date..."></input>
<input type="button" id="input-go" value="Go" onclick="goButtonOnClick()"></input>
</form>
</div>
<div id="results" style="display:none">
150 days from
<span id="result-label-inputdate">FOOBAR</span>
is
<span id="result-150">FOOBAR</span>
</div>
<script src="js/main.js"></script>
</body>
</html>