lunbox
lunbox

Reputation: 363

How to use ionic datetime to show future years

I have an ionic date-time. It's working, but it only goes up to this year and backward.

What I want is to go from this year and forward. Is it possible?

<ion-item>
<ion-label>Event Date</ion-label>
<ion-datetime displayFormat="D MMM, YY" pickerFormat="DD MMM YYYY" [(ngModel)]="eventDate">
</ion-datetime>

Upvotes: 2

Views: 3008

Answers (1)

Melchia
Melchia

Reputation: 24224

You can add the attribute max to ion-date like the following:

<ion-item>
<ion-label>Event Date</ion-label>
<ion-datetime  min="2018" max="2099-10-31" displayFormat="D MMM, YY" pickerFormat="DD MMM YYYY" [(ngModel)]="eventDate">
</ion-datetime>

Upvotes: 5

Related Questions