NetCZ/vue-pikaday

How do you assign/set the date?

Closed this issue · 3 comments

I have an instance:
<vue-pikaday ref="vPikaday"

and in my code I'm trying to set the date as such:
this.$refs.vPikaday.setDate('2019-11-11')

Is this possible? Can you send me an example of how to set the date? Thanks!!

Sorry, I couldn't respond sooner - I've been out sick.

Anyway, I was using v-model, but I was also using Vuelidate (https://vuelidate.netlify.com/), so now I'm wondering if that was the problem. The code looked like this:

Screen Shot 2019-10-11 at 8 32 13 AM

The problem was that the input was not displaying the date when trying to edit the record, so it appeared that the date was not being saved.

Until I can resolve this I've stripped out Vue-Pikaday and am using just Pikaday.

NetCZ commented

Hi @chrismartinez99, It sounds odd. Can you check if there could be some other place that might affect the model and also the options you are passing? I'm using Vuelidate with the library without problems. Check jsfiddle https://jsfiddle.net/mupf3b5a/