Ion-datetime displayFormat ignored in ion-modal

I tested ion-datetime with several formats to display the time, it works fine in a normal page but in a ion-modal it always displays the default format (same as if displayFormat attribute is omitted)

in a page: OK

in a modal: NOK
The expected format is HH:mm but is not taken into account

Below the code snippet in the modal (same outcome with/without minuteValues attribute)

<ion-row>
    <ion-col>
        <ion-datetime displayFormat="HH:mm" minuteValues="0,15,30,45"
          placeholder="Select Time">
        </ion-datetime>
    </ion-col>
</ion-row>

The modal is started as follows:

async presentModal() {
    const modal = await this.modalController.create({
      component: ModalPage,
      swipeToClose: true
    });
    return await modal.present();
}

Working since I upgraded on Ionic 5.

This is still an issue for me, but with a more recent version!

Ionic:

   Ionic CLI                     : 6.10.1 (/usr/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.3.1
   @angular-devkit/build-angular : 0.901.10
   @angular-devkit/schematics    : 9.1.10
   @angular/cli                  : 9.1.10
   @ionic/angular-toolkit        : 2.3.0
1 Like

I have the same issue, updated my project from Ionic 4 to 5 but it still exists.

Anybody an idea?

1 Like

Up.
Same issue…

   Ionic CLI                     : 6.16.3 (/usr/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.14
   @angular-devkit/build-angular : 0.1002.3
   @angular-devkit/schematics    : 12.2.2
   @angular/cli                  : 10.2.3
   @ionic/angular-toolkit        : 2.3.3

You can use this.

In Html :

<ion-datetime displayFormat="{{displayFormat}}" placeholder="Select Time">
</ion-datetime>

In Typescript :
displayFormat = “HH:mm”;