ankurk91 / vue-bootstrap-datetimepicker

Vue.js component for eonasdan bootstrap datetimepicker
MIT License
223 stars 66 forks source link

this.dp.date is not a function #19

Closed arabideau closed 6 years ago

arabideau commented 6 years ago

I'm submitting a ... (check one with "x")

[ ] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[X ] Other, please describe

Tell about your platform

Current behavior I'm attempting to create a component similar to what you've created with some minor changes to the template. However, I receive an error from the line this.dp.date(this.value) reading: "this.dp.date is not a function" in spite of the fact that this.dp does appear to be the expected datetimepicker instance.

Have you experience similar issues when working on this project? Any guidance you could provide me to accessing the functions and properties of the datetimepicker element as I would expect to be able to within my component would be very much appreciated.

Thanks, Aaron

ankurk91 commented 6 years ago

I am wondering what change you have made to template, my template is just two lines 😄

<div class="datetimepicker-inline" v-if="config.inline"></div>
  <input type="text" class="form-control" v-else>

Anyway; I can not help without looking into your code. What issues you faced using my package that leads you to create your own?

Just a prediction - eonasdan-bootstrap-datetimepicker stores its instance in data on the same element. You can access that instance like -

var dp = jQuery("#input-id").data('DateTimePicker');
dp.methodYouWantToAccess()