Open mtnair opened 4 years ago
How can i fix that on my local? (Sorry for the stupid question, i am new)
This repository is dead - we might never see it being fixed or even updated for ionic 5
How can i fix that on my local? (Sorry for the stupid question, i am new)
Honestly, I don’t know. I cloned the repo and copied the code from the plugin to my codebase and fixed it myself by editing the code. I also fixed other problems mentioned in other issues (ionicons, footer height).
Ok i see. It would be awesome if you could push that stuff to github for us to also use :)
A workaround for this problem is to invoke the datepicker from code side:
async openDatePicker() {
const datePickerModal = await this.modalCtrl.create({
component: Ionic4DatepickerModalComponent,
cssClass: 'li-ionic4-datePicker',
componentProps: { 'objConfig': this.datePickerObj }
});
await datePickerModal.present();
datePickerModal.onDidDismiss().then((data) => {
this.myDate = data.data.date;
});
}
<ion-input placeholder="bla" readonly [(ngModel)]="myDate" (click)="openDatePicker()"> </ion-input>
Hello
@RomuloPBenedetti
do you face issue like
Error: NG0906: The Ionic4DatepickerModalComponent is not an Angular component, make sure it has the @Component
decorator.
Let me know if yes and you already fix
Thank you
(I know this component was made for Ionic 4, though I encountered following problem with Ionic 5 and Angular 9; I don't know whether this still works with Ionic 4)
When using the directive to add the date picker to an
ion-input
, the input field doesn't update its value to the picked date. It took me a while to find out why, it seems like theproviders: [NgModel]
option in the@Directive()
decorator is the issue. When removing this line, the date picker works as expected. See: https://github.com/logisticinfotech/ionic4-datepicker/blob/master/projects/ionic4-datepicker/src/lib/li-ionic4-datepicker.directive.ts#L12