Bootstrap date range picker get current date the mouse is hovering over

Viewed 4959

THIS DATE PICKER HAS THE FUNCTIONALITY IM AFTER. http://www.daterangepicker.com/

But Im using this plugin, how do I get current date the mouse is hovering over? For an example if I hover over 23th Feb 2016, how do I get the date 23rd? getDate doesnt trigger until I click on a date. So current date on hover? Thanks a lot

NOTE

I have jquery-ui and bootstrap datepicker both on the same page so there was a conflict. To resolve the conflict, I am using bootstrapDP instead of datepicker.

MY HTML

<div class="home-check-in">
  <div class="search-form-group calendar">
    <span class=" date-dropdown-select">
    <div class="input-daterange input-group" id="datepicker2">
      <input type="text" required readonly class="input-group form-control" placeholder="dd/mm/yyyy" id="FromDate" name="start" />
      <span class="input-group-addon"></span>
      <input type="text" required readonly class="input-group form-control"  placeholder="dd/mm/yyyy" id="ToDate" name="end" />
    </div>
    </span> </div>
</div>

MY JS

$('.input-daterange').bootstrapDP({

    startDate: "+0d",
    defaultViewDate : "+0d",
    format: "dd-M-yyyy",
    maxViewMode: 3,
    autoclose: true,
    orientation: "bottom auto",
    disableTouchKeyboard:true,

}).on("changeDate", function() {

    $("#ToDate").focus();   //popup up end date calendar
    var selectedFromDate = $('#FromDate').bootstrapDP("getDate");
    var selectedToDate = $('#ToDate').bootstrapDP("getDate");
    $("#from").val(dateFormat(selectedFromDate,'yyyy-mm-dd'));
    $("#to").val(dateFormat(selectedToDate,'yyyy-mm-dd'));
});
4 Answers
Related