iamraviraj
iamraviraj

Reputation: 191

Comiseo daterange picker options

I am using date range picker from http://tamble.github.io/jquery-ui-daterangepicker/

All I want is a drop down to select Month & Year. I know there are options available to jQuery UI to render as a drop down instead of text for month and year.

However when I used that it applies only on first Datepicker only. I want drop down on both calender.

Below capture is form my demo on which I am working. enter image description here

Upvotes: 0

Views: 4058

Answers (1)

Just code
Just code

Reputation: 13801

I found reference from here

var $datePicker = $("#TxtStrtDate,#TxtExpDte");

$datePicker.datepicker({
    changeMonth: true,
    changeYear: true,
    inline: true,
    altField: "#datep",
 }).change(function(e){
    setTimeout(function(){   
       console.log(e, e.currentTarget, $datePicker.find('.ui-datepicker-current-day:visible')[0]);
       $datePicker
         .find('.ui-datepicker-current-day')
         .next('td')
         .children('.ui-state-default')
         .addClass('ui-state-active');
    });
});

Fiddle

Upvotes: 2

Related Questions