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

DatePicker year value isn't set correctly #28

Closed
levitatejay opened this issue Apr 29, 2016 · 1 comment
Closed

DatePicker year value isn't set correctly #28

levitatejay opened this issue Apr 29, 2016 · 1 comment

Comments

@levitatejay
Copy link

levitatejay commented Apr 29, 2016

I've found that when initializing the datepicker with a starting value it seems to init with the correct day & month but not year.

You can see this in the current model binding example:
http://angular2-materialize.surge.sh/#/modelbindings

@rubyboy
Copy link
Contributor

rubyboy commented Apr 30, 2016

Thanks for reporting this issue.

This was actually a problem in the example code. It wasn't setting the format properly, so datepicker couldn't pick up the year.
Here's the updated binding code:

<input type="text" [(ngModel)]="datepicker" materialize="pickadate" [materializeParams]="[{format:'dd/mm/yyyy'}]" />

The example now works as expected: http://angular2-materialize.surge.sh/#/modelbindings

@rubyboy rubyboy closed this as completed Apr 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants