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

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(