Components: md-datepicker: format date

Created on 30 May 2017  路  5Comments  路  Source: angular/components

Hello

Is there a possibility to specify format of the date shown in text. e.g. DD-MM-YYYY. API says something about inheriting classes.

Thanks.

Most helpful comment

I need to make date format like : yyyy-mm-dd , how can i achieve this?

All 5 comments

Thanks.
This solution works fine

import { DateAdapter } from '@angular/material';
export class Test {
constructor(private dateAdapter: DateAdapter<Date>) {
this.dateAdapter.setLocale('nl');
}
}
`

Hey @drweb86-work
can you share more?
I'm having the same with you implementation though as you see the date appears correctly on inptut field:
image
But when I open the date picker it doesn't/ only if I input manually the US format the datepicker shows the correct date in calendar:
image

I need to make date format like : yyyy-mm-dd , how can i achieve this?

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings