This repository was archived by the owner on Mar 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ declare var moment: any;
109
109
<label class="hourLabel">{{locale.hour}}:</label>
110
110
<input #hours class="hourInput"
111
111
tabindex="90000"
112
- (change)="selectDateTime( )"
112
+ (change)="selectTime(hours.value, minutes.value )"
113
113
type="range"
114
114
min="{{minHour || 0}}"
115
115
max="{{maxHour || 23}}"
@@ -120,7 +120,7 @@ declare var moment: any;
120
120
<input #minutes class="minutesInput"
121
121
tabindex="90000"
122
122
step="{{minuteStep}}"
123
- (change)="selectDateTime( )"
123
+ (change)="selectTime(hours.value, minutes.value )"
124
124
type="range" min="0" max="59" range="10" [(ngModel)]="minute"/>
125
125
</div>
126
126
</div>
@@ -504,6 +504,18 @@ export class NguiDatetimePickerComponent {
504
504
this . selectDateTime ( ) ;
505
505
}
506
506
507
+ /**
508
+ * set the hour and minute
509
+ * @param hour {string}
510
+ * @param minute {string}
511
+ */
512
+ public selectTime ( hour , minute ) {
513
+ //NOTE: must get hour & minute because 2-way binding does not work with range input in IE <= 11
514
+ this . hour = parseInt ( hour , 10 ) || 0 ;
515
+ this . minute = parseInt ( minute , 10 ) || 0 ;
516
+ this . selectDateTime ( ) ;
517
+ }
518
+
507
519
/**
508
520
* set the selected date and close it when closeOnSelect is true
509
521
* @param date {Date}
You can’t perform that action at this time.
0 commit comments