xxxxxxxxxx
1
<br>
2
3
<div class="form-outline timepicker-default-time-string-pm">
4
<input type="text" class="form-control" id="form2" />
5
<label class="form-label" for="form2">With string PM</label>
6
</div>
7
8
<br>
9
10
<div class="form-outline timepicker-default-time-string-am">
11
<input type="text" class="form-control" id="form2" />
12
<label class="form-label" for="form2">With string AM</label>
13
</div>
14
15
<br>
16
17
<div class="form-outline timepicker-default-time-string-without-pm-am">
18
<input type="text" class="form-control" id="form2" />
19
<label class="form-label" for="form2">With string without AM/PM</label>
20
</div>
21
22
<br>
23
24
<div class="form-outline timepicker-default-time-string-24h ">
25
<input type="text" class="form-control" id="form2" />
26
<label class="form-label" for="form2">With string 24h</label>
27
</div>
28
29
<br>
30
31
<div class="form-outline timepicker-default-time-with-new-date-12h">
32
<input type="text" class="form-control" id="form2" />
33
<label class="form-label" for="form2">With new Date with 12h</label>
34
</div>
35
36
<br>
37
38
<div class="form-outline timepicker-default-time-with-new-date-24h">
39
<input type="text" class="form-control" id="form2" />
40
<label class="form-label" for="form2">With new Date with 24h</label>
41
</div>
1
1
xxxxxxxxxx
1
//Default time string PM
2
const pickerStartedPM = document.querySelector('.timepicker-default-time-string-pm ');
3
const tmStartedPM = new mdb.Timepicker(pickerStartedPM, {
4
defaultTime: '02:12 PM'
5
});
6
7
//Default time string AM
8
const pickerStartedAM = document.querySelector('.timepicker-default-time-string-am');
9
const tmStartedAM = new mdb.Timepicker(pickerStartedAM, {
10
defaultTime: '05:12 AM'
11
});
12
13
14
//Default time without PM/AM
15
const pickerStartedWithoutPmAm = document.querySelector(
16
'.timepicker-default-time-string-without-pm-am'
17
);
18
const tmStartedWithoutPmAm = new mdb.Timepicker(pickerStartedWithoutPmAm, {
19
defaultTime: '05:12',
20
});
21
22
//Default time with 24h
23
const pickerStartedWith24h = document.querySelector('.timepicker-default-time-string-24h');
24
const tmStartedWith24h = new mdb.Timepicker(pickerStartedWith24h, {
25
defaultTime: '23:44',
26
format24: true,
27
});
28
29
//Default time date 12h
30
const pickerStartedWithDate12h = document.querySelector('.timepicker-default-time-with-new-date-12h');
31
const tmStartedWithDate12h = new mdb.Timepicker(pickerStartedWithDate12h, {
32
defaultTime: new Date(),
33
});
34
35
//Default time date 24h
36
const pickerStartedWithDate24h = document.querySelector('.timepicker-default-time-with-new-date-24h');
37
const tmStartedWithDate24h = new mdb.Timepicker(pickerStartedWithDate24h, {
38
defaultTime: new Date(),
39
format24: true,
40
});
Console errors: 0