user1199808
user1199808

Reputation: 303

Ionic 2 DatePicker Customize

Is it possible to customize standard ionic 2 datepicker to display day also, meaning when user selects date, month , year, it would be nice to see what day they are choosing.

Reference: http://blog.ionic.io/ionic-2-fixing-date-inputs-for-the-mobile-web/

Upvotes: 1

Views: 1187

Answers (2)

Bitzel
Bitzel

Reputation: 61

If you want to display the short name of day in the datepicker you should use:

 <ion-datetime
     pickerFormat="mm DDD MMM YYYY"
     ...
>
</ion-datetime>

Upvotes: 0

I don't understand exactly your question, but you can display more than 3 elements in a Ionic DateTime. This is just as easy as modify the pickerFormat component parameter. For example this code shows four elements to pick: hours, days, months and year.

<ion-datetime
     pickerFormat="mm DD MMM YYYY"
     ...
>
</ion-datetime>

In the following link you will see all possible formats an options to set into the pickerFormat Input.

DateTime

I hope this can help.

Upvotes: 4

Related Questions