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!!
Hi @chrismartinez99, is there a reason not to use v-model
? See https://enrian.github.io/vue-pikaday/guide/usage.html#basic-example.
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:
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.
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/