-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Description
Bug Report
Ionic version:
[x] 5.30.0
Current behavior:
This is the bug related to the ion-datetime. When the displayFormat is set to "HH:mm" and min is set to current day (today) & max is set to another day (e.g. tomorrow), then the picker is not visible. It shows white area on Android and some buggy lines on iOS. Works OK, when the day is not exceeded.
Expected behavior:
Possibility to set min date to now e.g. ('2020-09-15T21:58:35+02:00') and max date to +4h e.g. ('2020-09-16T01:58:35+02:00') - tomorrow. Then user should be able to choose the time from 21:58 -> 01:58
Steps to reproduce:
simple application: https://github.com/jammin197/ion-datetime-Bug22056.git
In javascript part set min='2020-09-15T21:58:35+02:00' & max='2020-09-16T01:58:35+02:00'
openTimePicker() {
this.timePickerMin = '2020-09-15T21:58:35+02:00';
this.timePickerMax = '2020-09-16T01:58:35+02:00';
this.timePicker.open();
}
Angular component (nothing special):
export class TestComponent implements OnInit {
@ViewChild('timePicker') timePicker: IonDatetime;
customTimePickerOptions: any;
timePickerMin;
timePickerMax;
constructor() {
this.customTimePickerOptions = {
buttons: [{
text: 'Dismiss',
handler: () => {
this.onTimePickerDismiss();
// return false; <-- do not dismiss
}
},
{
text: 'Confirm',
handler: (data) => { this.onTimePickerConfirm(data); }
}]
};
}
}
HTML:
<ion-datetime #timePicker displayFormat="HH:mm" [pickerOptions]="customTimePickerOptions" [min]="timePickerMin" [max]="timePickerMax"></ion-datetime>
Other information: (screenshots for iOS & Android)
iOS
Ionic info:
Ionic:
Ionic CLI : 6.11.8 (C:\Users\jammin\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 5.5.0
@angular-devkit/build-angular : 0.1100.2
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 2.4.1
@capacitor/core : 2.4.1
Utility:
cordova-res : 0.15.1
native-run : 1.1.0
System:
NodeJS : v12.14.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.4
OS : Windows 10