简体   繁体   中英

Bootstrap Datetimepicker Default Date input field empty Not working

I'm using datetimepicker plugin. I want the default input field should be empty instead of showing the current date.

I have tried this so far.

autoUpdateInput": false and "defaultDate": "", these are not working.

<div class="input-group  date">
    <input type="text" name="dates" class="form-control daterange" />              
</div>

$('.daterange').daterangepicker({   
         //"autoUpdateInput": false,
         
        "locale": {
            
            "container": "#CalModal",
            "defaultDate": "",
            "format": "MM/DD/YYYY",
            "separator": " / ",
            "customRangeLabel": "Custom",
            "monthNames": [
                "January",
                "February",
                "March",
                "April",
                "May",
                "June",
                "July",
                "August",
                "September",
                "October",
                "November",
                "December"
            ],
         }      
    });

put something like this $('.daterange').val('') after your code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM