0
votes

Hello I'm new to Ionic and I'm trying to create a datepicker in an input field.Something like this:

I saw the docs from Ionic framework but they have another form and doesn't work https://ionicframework.com/docs/native/date-picker/

2
What do you have? What piece of your code is not working? What kind of form are you using?Anjil Dhamala
I'm new to this,an example will helped me a lotEraldo Guri

2 Answers

2
votes

Here's a DateTime UI Component from Ionic. Ionic DateTime

Template Usage example

Reactive Forms

<form [formGroup]="signupForm">
    <ion-datetime formControlName="signupDate"></ion-datetime>
</form>

with ngModel

<ion-datetime [(ngModel)]="signupDate"></ion-datetime>
0
votes

using ionic v5 & v4 you just need to use the below template:-

 <ion-item>
<ion-label>Date</ion-label>
<ion-datetime displayFormat="DD MMMM YY, HH:mm a" min="2000" max="2025">
</ion-datetime>