jQuery Date Picker – disable past dates

You must create a new date object and set it as minDate when you initialize the datepickers <label for=”from”>From</label> <input type=”text” id=”from” name=”from”/> <label for=”to”>to</label> <input type=”text” id=”to” name=”to”/> var dateToday = new Date(); var dates = $(“#from, #to”).datepicker({ defaultDate: “+1w”, changeMonth: true, numberOfMonths: 3, minDate: dateToday, onSelect: function(selectedDate) { var option = this.id == … Read more

Test if element already has jQuery datepicker

Wow can’t believe I missed this one. Line 108 of ui.datepicker.js: /* Class name added to elements to indicate already configured with a date picker. */ markerClassName: ‘hasDatepicker’, So I just need to test for hasClass(‘hasDatepicker’). This seems like the most straightforward way. Furthermore, this statement checks whether the datepicker is currently opened (for anyone … Read more

How to have at least two datepickers of ui-bootstrap on a single page?

Rather than using a different function you can use a different is-open attribute and then pass the attribute in through the ng-click function. You still need different models: <div> <div class=”form-horizontal pull-left”> <input type=”text” datepicker-popup=”dd-MMMM-yyyy” ng-model=”dt1″ is-open=”opened1″ min=”minDate” max=”‘2015-06-22′” datepicker-options=”dateOptions” date-disabled=”disabled(date, mode)” ng-required=”true”/> <button class=”btn” ng-click=”open($event,’opened1’)”><span class=”glyphicon glyphicon-calendar”></span></button> </div> <div class=”form-horizontal pull-left”> <input type=”text” datepicker-popup=”dd-MMMM-yyyy” … Read more

Bootstrap Datepicker appearing at incorrect location in a modal

I just ran into this same issue. I was able to solve it by adding a container attribute to the div. $(‘#myDatePicker’).datepicker({ container:’#myModalId’ }); or if you are using the “lazy load” method as I was: <input id=’myDatePicker’ data-provide=”datepicker” data-date-container=”#myModalId”> Reference : http://bootstrap-datepicker.readthedocs.org/en/latest/options.html Hope it helps someone else!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)