I am new in 'angular2' and 'angular js material'. I am using material-datepicker in my project.
This is my the date picker code
<material-datepicker placeholder="Select Date" [(date)]="currentDate" name="currentDate" required></material-datepicker>
It will be display in browser as shown below.
My concern is date format issue. How to set the date format from 2017/04/27 to April 27 2017.
You can use dateFormat
option an specify MMMM DD YYYY
tokens where:
MMMM
is name monthDD
is day of the monthYYYY
is the yearas stated in the momentjs docs.
Your code will be like the following:
<material-datepicker [dateFormat]="'MMMM DD YYYY'" placeholder="Select Date" [(date)]="currentDate" name="currentDate" required></material-datepicker>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With