-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaScriptSamples1.html
More file actions
58 lines (48 loc) · 2.08 KB
/
Copy pathJavaScriptSamples1.html
File metadata and controls
58 lines (48 loc) · 2.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<script src="Scripts/jquery-3.0.0.js"></script>
<script src="Scripts/bootstrap.js"></script>
<script src="Scripts/BootBox/bootbox.js"></script>
<script src="Scripts/BootBox/bootbox.locales.js"></script>
<link href="Content/bootstrap.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div class="form-row">
<div class="col">
<button id="iterateMonthsButton" class="btn btn-primary btn-block" type="submit">1</button>
</div>
<div class="col">
<button class="btn btn-primary btn-block" type="submit">Filtri</button>
</div>
<div class="col">
<button class="btn btn-primary btn-block" type="submit">Filtri</button>
</div>
</div>
<div class="form-row mt-2">
<div class="col">
<button class="btn btn-primary btn-block" type="submit">Filtri</button>
</div>
<div class="col">
<button class="btn btn-primary btn-block" type="submit">Filtri</button>
</div>
<div class="col">
<button class="btn btn-primary btn-block" type="submit">Filtri</button>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#iterateMonthsButton').click(function (event) {
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const year = new Date().getFullYear();
const getDaysInMonth = month => new Date(year, new Date(`1-${month}-${year}`).getMonth() + 1, 0).getDate();
months.forEach(m => console.log(`${m} has ${getDaysInMonth(m)} days in ${year}`));
});
});
</script>
</body>
</html>