HTML
xxxxxxxxxx
1
<!-- Button trigger modal -->
2
<button
3
type="button"
4
class="btn btn-primary"
5
data-toggle="modal"
6
data-target="#exampleModal1"
7
>
8
Launch datepicker inline
9
</button>
10
11
<!-- Modal -->
12
<div
13
class="modal fade"
14
id="exampleModal1"
15
tabindex="-1"
16
aria-labelledby="exampleModalLabel"
17
aria-hidden="true"
18
>
19
<div class="modal-dialog">
20
<div class="modal-content">
21
<div class="modal-header">
22
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
23
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
24
<span aria-hidden="true">×</span>
25
</button>
26
</div>
27
<div class="modal-body">
28
<div class="form-outline datepicker" data-inline="true">
29
<input type="text" class="form-control" id="exampleDatepicker2" />
30
<label for="exampleDatepicker2" class="form-label">Select a date</label>
31
</div>
32
</div>
33
<div class="modal-footer">
34
<button type="button" class="btn btn-secondary" data-dismiss="modal">
35
Close
36
</button>
37
<button type="button" class="btn btn-primary">Save changes</button>
38
</div>
39
</div>
40
</div>
41
</div>
42
43
<!-- Button trigger modal -->
44
<button
45
type="button"
46
class="btn btn-primary"
47
data-toggle="modal"
48
data-target="#exampleModal2"
49
>
50
Launch datepicker not inline
51
</button>
52
53
<!-- Modal -->
54
<div
55
class="modal fade"
56
id="exampleModal2"
57
tabindex="-1"
58
aria-labelledby="exampleModalLabel"
59
aria-hidden="true"
60
>
61
<div class="modal-dialog">
62
<div class="modal-content">
63
<div class="modal-header">
64
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
65
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
66
<span aria-hidden="true">×</span>
67
</button>
68
</div>
69
<div class="modal-body">
70
<div class="form-outline datepicker">
71
<input type="text" class="form-control" id="exampleDatepicker2" />
72
<label for="exampleDatepicker2" class="form-label">Select a date</label>
73
</div>
74
</div>
75
<div class="modal-footer">
76
<button type="button" class="btn btn-secondary" data-dismiss="modal">
77
Close
78
</button>
79
<button type="button" class="btn btn-primary">Save changes</button>
80
</div>
81
</div>
82
</div>
83
</div>
CSS
1
1
JS
1
1
Console errors: 0