bootstrap-datepicker

How do you prevent bootstrap-datepicker from clearing existing value from input if no date is selected?

做~自己de王妃 提交于 2019-11-27 06:37:33
问题 I have have a div with a user's date of birth pre-populated with php: <div id="datepicker" class="input-group date"> <label for="dob">Date of Birth</label> <input type="text" class="form-control" id="dob" name="dob" value="<?php $date = new DateTime($this->swimmers->dob); echo $date->format('d/m/Y');?>"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span> </div> The javascript: <script> $('.container .input-group.date').datepicker({ startDate: "01/01/1900", endDate:

bootstrap datepicker change date event doesnt fire up when manually editing dates or clearing date

≡放荡痞女 提交于 2019-11-27 02:06:24
问题 <script type="text/javascript"> // When the document is ready $(document).ready(function () { $('.datepicker').datepicker({ format: "yyyy-mm-dd", }).on('changeDate', function(ev){ // do what you want here $(this).datepicker('hide'); }).on('changeDate', function(ev){ if ($('#startdate').val() != '' && $('#enddate').val() != ''){ $('#period').text(diffInDays() + ' d.'); } else { $('#period').text("-"); } }); }); </script> So here's what my datepicker looks like. So basically when I change date

Limit bootstrap-datepicker to weekdays only?

南笙酒味 提交于 2019-11-26 22:39:30
Is there anyway to allow only weekday selections in the bootstrap date picker found below? https://github.com/eternicode/bootstrap-datepicker/ I'm instantiating the date picker like this: $('#datepicker').datepicker(); /* Update datepicker plugin so that MM/DD/YYYY format is used. */ $.extend($.fn.datepicker.defaults, { parse: function (string) { var matches; if ((matches = string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/))) { return new Date(matches[3], matches[1] - 1, matches[2]); } else { return null; } }, format: function (date) { var month = (date.getMonth() + 1).toString(), dom = date

Detect change to selected date with bootstrap-datepicker

让人想犯罪 __ 提交于 2019-11-26 17:41:30
问题 I have an input element with an attached datepicker created using bootstrap-datepicker. <div class="well"> <div class="input-append date" id="dp3" data-date="2012-01-02" data-date-format="yyyy-mm-dd"> <input type="text" id="date-daily"> <span class="add-on"><i class="icon-th"></i></span> </div> </div> <script language="JavaScript" type="text/javascript"> $(document).ready(function() { $('#dp3').datepicker(); $('#date-daily').val('0000-00-00'); $('#date-daily').change(function () { console.log

jQuery ui datepicker conflict with bootstrap datepicker

北战南征 提交于 2019-11-26 16:53:15
问题 I want to show two months using bootstrap datepicker. After search on google I am not able to find how to show multiple months using bootstrap datepicker. I found that I can use JQuery UI for displaying multiple months. But problem is: In my application they are using bootstrap date picker. When I am trying to use JQuery UI datepicker then Bootstrap datepicker override it and I am not able to see JQuery UI datepicker. Could you please suggest how to replace bootstrap datepicker to JQuery UI?

How to restrict the selectable date ranges in Bootstrap Datepicker?

非 Y 不嫁゛ 提交于 2019-11-26 16:05:36
I need to use datepicker which provides me the option of restricting the selectable dates. We had been using jQuery UI which is used to support it using minDate, maxDate options. $("#id_date").datepicker({minDate: +1, maxDate: '+1M +10D'}); Recently we started using Twitter Bootstrap for our styles. And apparently, Twitter Bootstrap is incompatible with jQuery UI styles. So I tried using one of the bootstrap compatible datepickers available at http://www.eyecon.ro/bootstrap-datepicker/ . Unfortunately, the above plugin is not as configurable as jQuery UI's datepicker. Can anyone help me out

Limit bootstrap-datepicker to weekdays only?

可紊 提交于 2019-11-26 08:25:37
问题 Is there anyway to allow only weekday selections in the bootstrap date picker found below? https://github.com/eternicode/bootstrap-datepicker/ I\'m instantiating the date picker like this: $(\'#datepicker\').datepicker(); /* Update datepicker plugin so that MM/DD/YYYY format is used. */ $.extend($.fn.datepicker.defaults, { parse: function (string) { var matches; if ((matches = string.match(/^(\\d{2,2})\\/(\\d{2,2})\\/(\\d{4,4})$/))) { return new Date(matches[3], matches[1] - 1, matches[2]); }