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

[Vue warn]: Invalid prop: type check failed for prop "value". Expected String, got Date. #58

Open
holic-cl opened this issue Jun 27, 2017 · 1 comment

Comments

@holic-cl
Copy link

Hi, i tried to give a computed property to the datepicker but is not accepting instances of Date or numbers (timestamps) and i need to give the hour to my datepicker.

I got:

[Vue warn]: Invalid prop: type check failed for prop "value". Expected String, got Date

As flatpickr documentation say it can specify date as Date, timestamps and strings.

To give it a default time when the module has just mounted i give the date value as ISO Date string format as workaround to set the clock on last edited value.

I don't know if i am doing something wrong or this feature is not supported yet.

Regards

@havgry
Copy link
Contributor

havgry commented Aug 6, 2017

I agree. Passing a Date object or a Unix timestamp works perfectly well and is probably preferable as it doesn't rely on string parsing. Keep in mind that currently a string is always returned so you'll have to deal with multiple types.

flatpickr returns an array of Date objects. I prefer this approach as it takes date parsing out of the equation (granted you supply a Date object in the first place). It's pretty straightforward to make the change but it would be a breaking change - I still think it should be done, though.

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