-
Notifications
You must be signed in to change notification settings - Fork 53
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
Added Modular and bindable date parser + bug on parsing date on tab keypress #221
Conversation
fix(md-datepicker): Datepicker opening when setting date through textbox feat(md-datepicker): Add modular and bindable way of adding parsers to datepicker
…ia-materialize-bridge # Conflicts: # dist/aurelia-materialize-bridge.js # dist/dev/dist/dev/pagination/pagination.js.map # dist/dev/dist/dev/sidenav/sidenav.js.map # dist/temp/aurelia-materialize-bridge.js
@@ -1,3 +1,7 @@ | |||
import {DatePickerDefaultParser} from '../../../../src/aurelia-materialize-bridge/datepicker/datepicker.default-parser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not import {DatePickerDefaultParser} from 'aurelia-materialize-bridge/datepicker/datepicker.default-parser';
? Did that not work?
Btw. if you export the default parser in index.js you should be able to reference it using import {DatePickerDefaultParser} from 'aurelia-materialize-bridge/datepicker.default-parser';
. When I recall correctly. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, did not come to mind. I didn't check if there was a aurelia-materialize-bridge alias in the config.js for the samples so I played it safe and did it directly ;)
I can change tomorrow though :)
Very nice, thanks! (that's not the reason I'm not merging that right now 😉 ) |
Hmm sure, But it will have to be from the next time since I pushed it all in one commit this time. I'll start doing feature branches then :) |
When I set a max date, I can still enter something out of range and the reult is stored in the view model. The date picker correctly restricts the date.. |
Okay, fixed that. 😄 |
#197
from the updated samples doc:
If you would like to configure different parsers to handle the editable option, simply bind the parsers property and push/remove/replace the array with your own Parser classes. The Parser class would need to consists of canParse(value) and parse(value). The example here allows you to type in "yesterday" and will parse for you yesterday's date.