bootstrap-datepicker icon indicating copy to clipboard operation
bootstrap-datepicker copied to clipboard

Open on calendar icon only

Open Zyles opened this issue 13 years ago • 5 comments

The old datepicker opened when clicking the calendar icon, but this opens on input field focus.

How do I change it to open only on calendar icon click?

Zyles avatar May 04 '13 01:05 Zyles

Had similar "issue" today. Later I figured out that the problem was actually in my code, creating .datepicker() directly form the <input> element rather than from the surrounding <div>.

See this sandbox example.

akoskm avatar May 05 '13 13:05 akoskm

Closing for #377

eternicode avatar Dec 17 '13 07:12 eternicode

Same issue I suffering... I want to open calender on click icon not on clicking input box. how to do this?

himmatdb avatar May 18 '15 13:05 himmatdb

@eternicode I'm having this same issue, and am not sure if #377 solved it or if the fix is still in the works... I'm using the "showOnFocus" method (set to False- have tried in both JS and HTML), but rather than only focusing when clicking the calendar icon, it eliminates focus on everything. Am I using the method incorrectly? Code sample below.

HTML:

<div class="input-group date">
    <input id="date" type="text" maxlength="14" class="form-control our-date-picker" data-provide="our-date-picker" data-date-autoclose="true" data-date-toggle-active="true" data-date-show-on-focus="false"/>
    <span class="input-group-addon">
        <i class="fa fa-calendar"></i>
    </span>
</div>

Javascript:

$('#sandbox-container input').datepicker({
    orientation: "top right",
    showOnFocus: "false"
});

krogis01 avatar Oct 08 '15 17:10 krogis01

this is working for me

    $(function () {
        $("#datepicker").datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: "dd/mm/yy"
        }).datepicker("setDate", new Date());

        $('#btnPicker').click(function () {
            //alert('clicked');
            $('#datepicker').datepicker('show');
        });

    });

gem007bd avatar Mar 16 '16 10:03 gem007bd