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

fix(datepicker): export MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS #4541

Merged
merged 1 commit into from
May 15, 2017

Conversation

crisbeto
Copy link
Member

  • Makes the MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS public.
  • Fixes some trailing whitespace in the datepicker readme.

Fixes #4534.

* Makes the MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS public.
* Fixes some trailing whitespace in the datepicker readme.

Fixes angular#4534.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 14, 2017
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels May 14, 2017
@jelbourn jelbourn merged commit 58c252f into angular:master May 15, 2017
@SamVerschueren
Copy link

Any idea when this will be released?

@karolmie1
Copy link

karolmie1 commented May 26, 2017

It's already available in beta.6 👍

@linuradu
Copy link

linuradu commented Jun 2, 2017

Could someone help me how can I customize date format with md-datepicker?

I'm using:

            <md-input-container class="whole-width">
            <input mdInput [mdDatepicker]="picker"  [(ngModel)]="contact.birthDate" 
                   placeholder="Birthdate">
                <button mdSuffix [mdDatepickerToggle]="picker"></button>
            </md-input-container>
            <md-datepicker #picker></md-datepicker>

And the date format that is sent to the backend is: 2017-06-14T21:00:00.000Z
I need to send like "MM/dd/yyyy"
Thank you!

@mmalerba
Copy link
Contributor

mmalerba commented Jun 2, 2017

@linuradu The NativeDateAdapter is not able to handle that format. Though we plan to add more adapters to material eventually, currently you'll have to create your own DateAdapter as described in the docs: https://material.angular.io/components/component/datepicker

@karolmie1
Copy link

@mmalerba Honestly this documentation is lacking and don't explain much. I wish there was an example or two to illustrate the process.

@rafaelss95
Copy link
Contributor

@mmalerba Can you give a simple example of how to create a DateAdapter? As @karolmie1 mentioned, the documentation is really lacking a concrete example.

@mmalerba
Copy link
Contributor

mmalerba commented Jun 4, 2017

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: MD_DATE_FORMATS is not exported - cannot customize date time formats
8 participants