Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md-datepicker: format date #4876

Closed
drweb86-work opened this issue May 30, 2017 · 5 comments
Closed

md-datepicker: format date #4876

drweb86-work opened this issue May 30, 2017 · 5 comments

Comments

@drweb86-work
Copy link

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.

@fxck
Copy link
Contributor

fxck commented May 30, 2017

read this discussion #4832

@drweb86-work
Copy link
Author

Thanks.
This solution works fine

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

@vapits
Copy link

vapits commented Aug 14, 2017

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

@surajkhanal
Copy link

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

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants