1
1
< div class ="row ">
2
- < div class ="col-md-6 ">
3
- < div class ="card ">
4
- < div class ="card-body ">
5
- < h4 class ="card-title "> Timepicker</ h4 >
6
- < h6 class ="card-subtitle "> This is basic Timepicker</ h6 >
7
- < ngb-timepicker [(ngModel)] ="time "> </ ngb-timepicker >
8
- < pre > Selected time: {{time | json}}</ pre >
9
- </ div >
10
- </ div >
11
- </ div >
12
- < div class ="col-md-6 ">
2
+ < div class ="col-md-6 ">
13
3
< div class ="card ">
14
4
< div class ="card-body ">
15
- < h4 class ="card-title "> Spinners</ h4 >
16
- < h6 class ="card-subtitle "> This is Spinners</ h6 >
17
- < ngb-timepicker [(ngModel)] ="time " [spinners] ="spinners "> </ ngb-timepicker >
18
- < button class ="m-t-1 m-t-10 btn btn-sm btn-outline-{{spinners ? 'success' : 'danger'}} " (click) ="toggleSpinners() ">
19
- Spinners - {{spinners ? "ON" : "OFF"}}
20
- </ button >
5
+ < h4 class ="card-title "> Seconds</ h4 >
6
+ < h6 class ="card-subtitle "> This is Seconds with the on off</ h6 >
7
+ < ngb-timepicker [(ngModel)] ="time " [seconds] ="seconds "> </ ngb-timepicker >
8
+ < button class ="btn btn-sm btn-outline-{{seconds ? 'success' : 'danger'}} " (click) ="toggleSeconds() ">
9
+ Seconds - {{seconds ? "ON" : "OFF"}}
10
+ </ button >
11
+ < hr >
12
+ < pre > Selected time: {{time | json}}</ pre >
21
13
</ div >
22
14
</ div >
23
15
</ div >
24
16
< div class ="col-md-6 ">
25
17
< div class ="card ">
26
18
< div class ="card-body ">
27
- < h4 class ="card-title "> Meridian</ h4 >
28
- < h6 class ="card-subtitle "> This is Meridian Timepicker</ h6 >
29
- < ngb-timepicker [(ngModel)] ="time " [meridian] ="meridian "> </ ngb-timepicker >
30
- < button class ="btn btn-sm btn-outline-{{meridian ? 'success' : 'danger'}} " (click) ="toggleMeridian() ">
31
- Meridian - {{meridian ? "ON" : "OFF"}}
32
- </ button >
33
- < hr >
19
+ < h4 class ="card-title "> Timepicker</ h4 >
20
+ < h6 class ="card-subtitle "> This is basic Timepicker</ h6 >
21
+ < ngb-timepicker [(ngModel)] ="time "> </ ngb-timepicker > < hr />
34
22
< pre > Selected time: {{time | json}}</ pre >
35
- </ div >
23
+ </ div >
36
24
</ div >
37
25
</ div >
26
+
27
+
38
28
< div class ="col-md-6 ">
39
29
< div class ="card ">
40
30
< div class ="card-body ">
41
- < h4 class ="card-title "> Seconds</ h4 >
42
- < h6 class ="card-subtitle "> This is Seconds with the on off</ h6 >
43
- < ngb-timepicker [(ngModel)] ="time " [seconds] ="seconds "> </ ngb-timepicker >
44
- < button class ="btn btn-sm btn-outline-{{seconds ? 'success' : 'danger'}} " (click) ="toggleSeconds() ">
45
- Seconds - {{seconds ? "ON" : "OFF"}}
46
- </ button >
47
- < hr >
48
- < pre > Selected time: {{time | json}}</ pre >
49
- </ div >
31
+ < h4 class ="card-title "> Meridian</ h4 >
32
+ < h6 class ="card-subtitle "> This is Meridian</ h6 >
33
+ < ngb-timepicker [(ngModel)] ="time " [meridian] ="meridian "> </ ngb-timepicker > < hr >
34
+ < button class ="btn btn-sm btn-outline-{{meridian ? 'success' : 'danger'}} " (click) ="toggleMeridian() ">
35
+ Meridian - {{meridian ? "ON" : "OFF"}}
36
+ </ button >
37
+ </ div >
50
38
</ div >
51
39
</ div >
52
- < div class ="col-md-12 ">
40
+ < div class ="col-md-6 ">
53
41
< div class ="card ">
54
42
< div class ="card-body ">
55
- < h4 class ="card-title "> Custom steps</ h4 >
56
- < h6 class ="card-subtitle "> This is Custom steps</ h6 >
57
- < ngb-timepicker [(ngModel)] ="time2 " [seconds] ="true "
58
- [hourStep] ="hourStep " [minuteStep] ="minuteStep " [secondStep] ="secondStep "> </ ngb-timepicker >
59
-
60
- < div class ="row ">
61
- < div class ="col-md-3 ">
62
- < label for ="changeHourStep "> Hour Step</ label >
63
- < input id ="changeHourStep " type ="number " class ="form-control form-control " [(ngModel)] ="hourStep " />
64
- </ div >
65
- < div class ="col-md-3 ">
66
- < label for ="changeMinuteStep "> Minute Step</ label >
67
- < input id ="changeMinuteStep " type ="number " class ="form-control form-control " [(ngModel)] ="minuteStep " />
68
- </ div >
69
- < div class ="col-md-3 ">
70
- < label for ="changeSecondStep "> Second Step</ label >
71
- < input id ="changeSecondStep " type ="number " class ="form-control form-control " [(ngModel)] ="secondStep " />
72
- </ div >
73
- </ div >
74
-
75
- < pre class ="m-t-20 "> Selected time: {{time2 | json}}</ pre >
43
+ < h4 class ="card-title "> Spinners</ h4 >
44
+ < h6 class ="card-subtitle "> This is Spinners Timepicker</ h6 >
45
+ < ngb-timepicker [(ngModel)] ="time " [spinners] ="spinners "> </ ngb-timepicker > < hr >
46
+ < button class ="m-t-1 btn btn-sm btn-outline-{{spinners ? 'success' : 'danger'}} " (click) ="toggleSpinners() ">
47
+ Spinners - {{spinners ? "ON" : "OFF"}}
48
+ </ button >
76
49
</ div >
77
50
</ div >
78
51
</ div >
79
- < div class ="col-md-12 ">
52
+ < div class ="col-md-6 ">
80
53
< div class ="card ">
81
54
< div class ="card-body ">
82
55
< h4 class ="card-title "> Custom validation</ h4 >
83
- < h6 class ="card-subtitle "> Illustrates custom validation, you have to select time between 12:00 and 13:59</ h6 >
84
- < div class ="form-group " [class.has-success] ="ctrl.valid " [class.has-danger] ="!ctrl.valid ">
85
- < ngb-timepicker [(ngModel)] ="time3 " [formControl] ="ctrl " required > </ ngb-timepicker >
86
- < div class ="form-control-feedback ">
87
- < div *ngIf ="ctrl.valid "> Great choice</ div >
88
- < div *ngIf ="ctrl.errors && ctrl.errors['required'] "> Select some time during lunchtime</ div >
89
- < div *ngIf ="ctrl.errors && ctrl.errors['tooLate'] "> Oh no, it's way too late</ div >
90
- < div *ngIf ="ctrl.errors && ctrl.errors['tooEarly'] "> It's a bit too early</ div >
56
+ < h6 class ="card-subtitle "> This is Spinners Timepicker</ h6 >
57
+ < div class ="form-group ">
58
+ < ngb-timepicker [formControl] ="ctrl " required > </ ngb-timepicker >
59
+ < div *ngIf ="ctrl.valid " class ="small form-text text-success "> Great choice</ div >
60
+ < div *ngIf ="ctrl.errors " class ="small form-text text-danger ">
61
+ < div *ngIf ="ctrl.errors['required'] "> Select some time during lunchtime</ div >
62
+ < div *ngIf ="ctrl.errors['tooLate'] "> Oh no, it's way too late</ div >
63
+ < div *ngIf ="ctrl.errors['tooEarly'] "> It's a bit too early</ div >
64
+ </ div >
91
65
</ div >
92
- </ div >
93
-
94
- < hr >
95
- < pre > Selected time: {{time3 | json}}</ pre >
96
- </ div >
97
- </ div >
98
- </ div >
99
- < div class ="col-md-12 ">
100
- < div class ="card ">
101
- < div class ="card-body ">
102
- < h4 class ="card-title "> Custom time adapter</ h4 >
103
- < h6 class ="card-subtitle "> This timepicker uses a custom Time adapter that lets you use your own model implementation. In this example we are converting from and to an ISO string (with the format HH:mm:ss)</ h6 >
104
- < ngb-timepicker [(ngModel)] ="time1 "> </ ngb-timepicker >
105
- < hr >
106
- < pre > Selected time: {{ time1 }}</ pre >
107
66
</ div >
108
67
</ div >
109
68
</ div >
69
+
110
70
</ div >
0 commit comments