Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

KTDatePicker – event not triggered when selecting a date


Hi,

I’m having an issue with KTDatePicker — the event is not triggered when a date is selected.

I’m trying to listen for a date click / selection using the following code:

const calendar = new KTDatePicker('#test-data', {
onClickDate(self, t) {
console.log(self.context.selectedDates);
},
});
calendar.init();

Unfortunately, the onClickDate callback is never executed after selecting a date in the UI
(no logs appear in the console).

Additional details:

the #test-data element exists in the DOM

calendar.init() is called after the page is loaded

the DatePicker renders correctly and the UI itself works

the issue occurs both on the first selection and when selecting another date

Could you please confirm:

whether onClickDate is the correct event for handling date selection?

if there is another event (e.g. onChange, onSelect, etc.) that should be used instead?

or if additional configuration options are required for this event to fire?

Thank you in advance for your help.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (0)