theroozbeh/vue2-persian-datepicker

How Get selected date

mariajhn opened this issue · 5 comments

Hi,
I want to use your datepicker, but I want to extract year, month and day from the selected date.
Could you please help me?!

Thnks

Unfortunately it is not possible right now.
For the time being you can split selected date with '/'
But this feature will be added.

Upgrade to latest version. Now you can listen to selected event, and use it's input parameter for getting year, month and day.

Many thanks for your reply.
When I run this code, the output is repeated three times in console !!!!
Isn't possible to use year, month or day as below:
{{date.year}}
But, I have another question,
I want to write this code when a date is selected:
v-on:selected="visitDate=date"
where myDate is a variable in a controller.
Is it possible?

Yes it is possible. Use parentheses function definition.
v-on:selected="(date) => {this.visitDate = date;}"