jquery-ui-datepicker

jQuery UI datepicker: add 6 months to another datepicker

雨燕双飞 提交于 2019-11-26 16:58:02
问题 I have two datepickers calendars, one for a start date, and another for an end date. What I want is to set dynamically the defaultDate of the second datepicker to be six months later than the first one, when the first date is picked. I know how to report the fisrt date to the second datepicker, but I don't know how to add six months to the first then add it as the defaultdate of the second datepicker Here is my code : $(".firstcal").datepicker({ dateFormat: "dd/mm/yy", onSelect: function

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 set minDate to current date in jQuery UI Datepicker?

早过忘川 提交于 2019-11-26 16:20:40
问题 This is my code and it is not working correctly. I want to set minDate to the current date. How can I do it? $("input.DateFrom").datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', maxDate: 'today', onSelect: function(dateText) { $sD = new Date(dateText); $("input#DateTo").datepicker('option', 'minDate', min); } 回答1: You can specify minDate as today by adding minDate: 0 to the options. $("input.DateFrom").datepicker({ minDate: 0, ... }); Demo : http://jsfiddle.net/2CZtV/

ipad web application: How do I prevent the keyboard from popping up on jquery datepicker

自作多情 提交于 2019-11-26 15:35:35
问题 I have a form with an date field with a jquery datepicker attached to it. When I select the date field the datepicker pops up but then the iPad keyboard slides into view and obscures the datepicker. How do I prevent the keyboard from popping up in this situation? 回答1: I used a slightly modified version of Rob Osborne's solution and it successfully prevented the keyboard from popping up on the iPad and iPhone. $(".datePicker").datepicker({ showOn: 'button', onClose: function(dateText, inst) {

Restrict date in jquery datepicker based on another datepicker or textbox

三世轮回 提交于 2019-11-26 14:32:25
I have two text boxes with a datepicker hooked up to them. The text boxes are for start date and end date. The first datepicker is setup so that the user cannot choose a date before today, but can choose any date in the future. How can I setup the second datepicker so that it cannot choose a date before the date chosen in the first date picker? For example: If today is 12/11/10 and I choose 12/15/10 in the first datepicker, then the second date picker shouldn't be able to choose anything before 12/15/10. Heres what I have so far: $("#txtStartDate").datepicker({ minDate: 0 }); $("#txtEndDate")

How to change the pop-up position of the jQuery DatePicker control

与世无争的帅哥 提交于 2019-11-26 14:23:06
Any idea how to get the DatePicker to appear at the end of the associated text box instead of directly below it? What tends to happen is that the text box is towards the bottom of the page and the DatePicker shifts up to account for it and totally covers the text box. If the user wants to type the date instead of pick it, they can't. I'd rather have it appear just after the text box so it doesn't matter how it adjusts vertically. Any idea how to control the positioning? I didn't see any settings for the widget, and I haven't had any luck tweaking the CSS settings, but I could easily be missing

setting min date in jquery datepicker

余生长醉 提交于 2019-11-26 12:26:49
问题 Hi i want to set min date in my jquery datepicker to (1999-10-25) so i tried the below code its not working. $(function () { $(\'#datepicker\').datepicker({ dateFormat: \'yy-mm-dd\', showButtonPanel: true, changeMonth: true, changeYear: true, showOn: \"button\", buttonImage: \"images/calendar.gif\", buttonImageOnly: true, minDate: new Date(1999, 10 - 1, 25), maxDate: \'+30Y\', inline: true }); }); ** if i change the min year to above 2002 than it will work fine but if i specify min year less

jQuery-UI datepicker default date

女生的网名这么多〃 提交于 2019-11-26 12:25:35
问题 I have a problem with the jQuery-UI datepicker, I have searched and searched but I didn\'t find the answer. I have the following code: <script type=\"text/javascript\"> $(function() { $(\"#birthdate\" ).datepicker({ changeMonth: true, changeYear: true, yearRange: \'1920:2010\', dateFormat : \'dd-mm-yy\', defaultDate: \'01-01-1985\' }); }); </script> I want that when the user click in the #birthdate input that the current date selected to be 01-01-1985 , now it\'s setting the current date. 回答1

Elegant method to generate array of random dates within two dates

大憨熊 提交于 2019-11-26 11:59:42
问题 I have a datepicker where I show two months and I want to randomly choose 3 dates in each visible month $(\'.date\').datepicker({ minDate: new Date(), dateFormat: \'DD, MM, d, yy\', constrainInput: true, beforeShowDay: processDates, numberOfMonths: 2, showButtonPanel: true, showOn: \"button\", buttonImage: \"images/calendar_icon.jpg\", buttonImageOnly: true }); Here is my calculation var now = new Date(); var nowTime = parseInt(now.getTime()/1000); var randomDateSet = {}; function

Jquery datepicker - only day and month

早过忘川 提交于 2019-11-26 11:27:39
问题 I want the user to specify their birthday or anniversary date (without year) in a form. For this, I want to use jquery datepicker but it should not show any year option at all. How to do it? I tried modifying the code in this so question by making changeDay: true and changeYear: false but could not get it to work. 回答1: set the css to hide the year and the dateFormat as K6t said .ui-datepicker-year{ display:none; } 回答2: You could do: $('#date').datepicker( { changeMonth: true, changeYear: true