Search code examples
datepickerionic2hybrid

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/


Solution

  • 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.