I am using jquery ui datepicker to show datepicker when someone clicks on the input with the help of following code snippet.
Code:
$('#datepicker').datepicker();
The problem I have with this is that the calendar should come as full width of the input before it.
I did search the internet and used a few code snippets but none worked.
My approach:
$('#datepicker').datepicker({
beforeShow: function(input, inst)
{
inst.dpDiv.css({ width: input.width + 'px'});
}
});
In the Fiddle the input's width is fixed as 500px, so datepicker width should also be 500px wide. And datepicker's width should adapt to whatever width is of this input.