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
Handling date picker properties in Vue JS #29
Comments
Hey, would you be able to create a codepen/jsfiddle/whatever which demonstrates your issue? I'm unfamiliar with Vue, so would take me a long time to recreate (and even then, it might not match your setup!). Would make it a lot easier to help out :) |
Hi, absolutely. Here's a link for a quick repro. Thanks for taking the time! |
@WickyNilliams @RiqueBR The first issue I see here is that you can’t change just one value inside the localization object. You need to pass in the whole object for things to work. Please see the last example on this page: https://duetds.github.io/date-picker/ |
That's brilliant! How about the dateAdapter? I've been trying to pass as a prop as well an object with those functions and it's not picking up. I've updated the repo.
|
By the way, I can submit a wee PR that would cover what we're chatting in here to the docs if that's alright. :) |
I think you need to explicitly tell vue to pass the objects as a property, not an attribute. Since it can't determine which to use, it defaults to attribute. If you look in dev tools you will see I just tested and this should work:
This answer on stackoverflow pointed me in the right direction: https://stackoverflow.com/questions/61385404/vuejs-cant-pass-object-to-web-component-using-v-bind I removed the localization part since it was incomplete and causing errors, but the same is true there once you complete the object. Hope that helps :) |
and yes PRs welcome! |
Hey @viljamis @WickyNilliams, thank you so much for this! I'll send a wee update of the docs to reflect this at some point this week. |
I've just submitted a PR for what we talked here and will close this issue now. Thanks for the prompt response, appreciate it! |
Describe the bug
Thank you very much for all your hard work, this date picker is incredibly neat!
I've been trying to implement this date picker into a Vue JS project. I'm a bit new and as I understand from your documentation, in order to use the properties of duet date picker (e.g. Localization, dateAdapter, direction, etc.) I need to override their defaults. I've been trying to add them as props to my component but so far no luck. Is this a bug or just a gap on my own understanding?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the placeholder to change it's label from "YYYY-MM-DD" to "DD/MM/YYYY"
Desktop (please complete the following information):
Additional context
Component in case:
The text was updated successfully, but these errors were encountered: