bootstrap-datepicker

Bootstrap datepicker not woking in modal

梦想与她 提交于 2019-12-11 07:22:43
问题 When I use a datepicker inside a modal the datepicker is not working. I use the event show.bs.modal to modify some content of the modal on show: $(function(){ $('#statusModal').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var title = button.data('title'); var input_date = button.data('date'); var modal = $(this); modal.find('.modal-title').text('Clicked: ' + title); modal.find('.modal-body #inputDate').val(input_date); $('#inputDate').datepicker(); }).on('hidden

bootstrap-datepicker.js using today's date when date cleared

馋奶兔 提交于 2019-12-11 04:53:43
问题 Using bootstrap-datepicker.js, very nice plugin. Everything works as expected, minus this one case, which could be me missing something within the documentation. Whenever a user enters a date and the textbox looses focus (user goes on to complete the rest of the form), if the user goes back to the textbox and attempts to remove the date, today's date is automatically populated. If you remove today's date, it automatically populates again...repeatedly. Is there an option I have missed that

Bootstrap 3 Datepicker + Moment.js , can't seem to get format to work

大兔子大兔子 提交于 2019-12-11 00:32:12
问题 I'm trying to get the following Bootstrap 3 plugin to work: http://eonasdan.github.io/bootstrap-datetimepicker/Options/ One of the requirement is Moment.js : http://momentjs.com/docs/#/customization/ My HTML is: <div class="container"> <div class='col-md-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker6'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <div

Highstock inputDateParser fires three times

孤街醉人 提交于 2019-12-10 14:25:47
问题 I am not sure what cause it to fire three times after selecting a date through date calendar. Here is the options set for rangeSelector rangeSelector:{ enabled:true, inputEnabled: true, inputDateFormat: '%d/%m/%Y', inputEditDateFormat: '%d/%m/%Y', inputDateParser: function (value) { value = value.split('/'); console.log(value); return Date.UTC( parseInt(value[0]), parseInt(value[1]) - 1, parseInt(value[2]) ); } } by using backbone.view jquery selector, here how i initiate the chart this.$el

Bootstrap Datepicker not working in chrome

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:03:55
问题 I use a Jquery plugin Bootstrap Datepicker. It works fine in firefox. Also, It works on some pages of my site in Google Chrome (Version 33.0.1750.117 m). However, there is one text input (name="TravelDate"), where this plugin does not work. This text input is placed on Bootstrap modal window. <script> $(function () { $("#date-trip").datepicker({ format: "dd.mm.yyyy", startDate: new Date(), todayBtn: "linked", language: "ru", autoclose: true }); }); </script> <!-- Modal --> <div class="modal

Make eternicode datepicker open on click, not focus

只愿长相守 提交于 2019-12-10 09:36:27
问题 The eternicode twitter bootstrap datepicker pops up as soon as the <input> field it is attached to gets focus , as you can see by tabbing onto the datepicker field on the official demo page. Instead, I want it to only open on click . Ideally the datepicker would just pop up on click of the calendar icon. How can I prevent it from popping up on focus? 回答1: In the current version of the library, there's no official support for what you want to do. The docs list all the kinds of markup you can

Why does angularjs bootstrap datepicker pick one day before?

百般思念 提交于 2019-12-10 09:17:04
问题 I'm using angularjs bootstrap datepicker directive and when I set a date from model it picks a day before the selected date. <button type="button" class="btn btn-sm btn-default" ng-click="dt = '2014-09-24'">2014-09-24</button> Here is a plunk with the issue. Is there any solution? 回答1: This is due to the way JS handles dates natively. AngularUI team mentions this in the docs. Here's one solution: Angular-UI One day is subtracted from date in ui-date 回答2: For anyone needing a solution in the

bootstrap-datepicker does not scroll when scrolling the modal

橙三吉。 提交于 2019-12-09 17:16:21
问题 I am using bootstrap-datepicker and would like to show the date-picker on the modal of bootstrap 2. The problem I got is the date-picker is not scrolling accordingly when scrolling the modal, it is still remained. The code: <button class="btn btn-primary" data-toggle="modal" data-target="#myModal">Launch Modal</button> <div id="myModal" class="modal hide fade" style="height: 400px; overflow: scroll"> <div style="height:300px"></div> <div>Choose Date: <input class="calendar" /> </div> <div

Bootstrap datepicker configuration to block specific dates (holidays)

两盒软妹~` 提交于 2019-12-09 03:20:41
问题 Has anyone figured out how to configure datepicker to not display specific dates (such as, say, July 4th)? It would seem that this could be done using the beforeShowDay but I'm not positive. 回答1: http://jsfiddle.net/Lr3taznx/ //a array of dates that should be blocked var forbidden=['12/25/2014','12/24/2014'] $('#datepicker').datepicker({ beforeShowDay:function(Date){ // var curr_day = Date.getDate(); var curr_month = Date.getMonth()+1; var curr_year = Date.getFullYear(); var curr_date=curr

Check if Bootstrap Datepicker script has loaded

孤街浪徒 提交于 2019-12-08 17:30:19
问题 I am receiving the error: Uncaught TypeError: undefined is not a function When I try to set up the datepicker: $('.datepicker').datepicker(); How can I determine if the datepicker has loaded or not? To be clear, I'm not using jQuery UI 回答1: You can check to see if the datepicker script has loaded using: if ($.fn.datepicker) { // ... } Then you can conditionally invoke the .datepicker() method if the script has loaded: if ($.fn.datepicker) { $('.datepicker').datepicker(); } Example Here In