-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
datepicker: startAt and setting value doesn't work correctly #4358
Comments
This is a limitation of the native JS Date object since It's not possible to set a parse format. We are planning to add a If you don't want to use moment, it's easy to write your own adapter for whatever date implementation you want |
Hmm, right. I've already written my own date-fns adapter, but apparently it cannot parse different formats either... yet anyway - date-fns/date-fns#375 But doesn't this basically mean that you won't able to use locale out of the box unless you use momentjs, which is absolutely humongous untreeshakable lib? Wouldn't it be worth shipping with an adapter that can do actually this? |
Happy to consider adding adapters for other implementations, but implementing robust internationalized date parsing and formatting is outside the scope of Angular Material. |
Closing this since its WAI for |
@mmalerba these issues will keep piling on, I think it would be worth adding some all caps bold statement to calendar docs that it doesn't support any other locale than those with |
I cannot understand how you guys from material are not providing at least one MomentDateAdapter, so that everyone can use a basic version of i18nalized date-pickers. I know there are ways to implement it, but only supporting |
@emreavsar We plan to offer a Moment adapter, we have some issues to resolve with our packaging structure before we can do that. We don't want to force a Moment.js dependency on people who aren't even using the adapter |
Of course i see your point. Hope to see the adapter, maybe you can give it
as a separate material-datepicker-extension package or so?
Cheers
…On Wed, 31 May 2017 at 18:42, mmalerba ***@***.***> wrote:
@emreavsar <https://github.com/emreavsar> We plan to offer a Moment
adapter, we have some issues to resolve with our packaging structure before
we can do that. We don't want to force a Moment.js dependency on people who
aren't even using the adapter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4358 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA5mlqfNWZlZ4aflJ4duKxrh2l_jY6zNks5r_Zh-gaJpZM4NON_M>
.
|
Found a simple workaround that works for my use-case. <md-input-container>
<input mdInput [mdDatepicker]="picker" placeholder="Choose a date" [(ngModel)]="date">
<button mdSuffix [mdDatepickerToggle]="picker"></button>
</md-input-container>
<md-datepicker #picker [startAt]="date"></md-datepicker> |
At the time of writing this |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
repro (using mmalerba:dp-a11y):
02/05/2017
06/02/2017
(should have been 06/05/2017)@mmalerba
The text was updated successfully, but these errors were encountered: