What I want to achieve is when I click on ion-select to open an ion-datetime.
What I achieved so far is opening from an ion-item, but it’s quite hard to customise to make it look as an ion-select.
I saw some posts in here using DatePicker from ionic-angular, but this doesn’t work anymore for ionic 5. If you have any suggestions that would be amazing. Thanks!
my HTML
<ion-item class="dateItem"(click)="openDatePicker()">Date of birth </ion-item>
<ion-datetime
formControlName="combinedSelects"
value="dob"
#dateTime
style="display: none;">
</ion-datetime>
My TS
import { Component, OnInit, ViewChild } from "@angular/core";
import { FormGroup, FormControl, Validators } from "@angular/forms";
@Component({
selector: "app-combined-selects",
templateUrl: "./combined-selects.component.html",
styleUrls: ["./combined-selects.component.scss"],
})
export class CombinedSelectsComponent implements OnInit {
date: String;
@ViewChild("dateTime") showDate;
constructor() {}
ngOnInit() {}
openDatePicker() {
this.showDate.open();
}
}