Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Facing issue to Tempus Dominus


My HTML:
<div class="date">
<div class="box depart" id="kt_daterangepicker_3">
<label>JOURNEY DATE</label>
<div class="value">06 Mar'23</div>
<span class="days">Thursday</span>
<input type="text" id="kt_daterangepicker_3_input">
</div>
</div>

My JS:
// date picker
var dateElement = document.querySelector('#kt_daterangepicker_3 .value');
var daysElement = document.querySelector('#kt_daterangepicker_3 .days');
var picker = new tempusDominus.TempusDominus(document.getElementById("kt_daterangepicker_3"), {
display: {
viewMode: "calendar",
components: {
decades: true,
year: true,
month: true,
date: true,
hours: false,
minutes: false,
seconds: false
}
},
restrictions: {
minDate: new Date() // set the minimum date to today's date
}
});

$('#kt_daterangepicker_3').on('click', function() {
if (picker._widget.classList.contains('tempusdominus-bootstrap-4')) {
if (picker._widget.classList.contains('open')) {
picker.hide();
} else {
picker.show();
}
} else {
console.error('Invalid picker element');
}
});


Problem:
when i picked any date need to set value & date.


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 (1)


Hi,

Can you please check the plugin's official documentation here? You should use the subscribe function to interact with the picker using its custom events or API methods.

Regards.


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  :(
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  :(