jquery-ui-datepicker

Get month name instead of number

戏子无情 提交于 2019-12-05 18:42:50
I am using the jQuery datepicker plugin. I can get the month number by $("#datepicker").datepicker('getDate').getMonth()+1 How can I get the month name directly (i.e. without using a switch case )? dacwe If you want a simple solution this is it: var months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var selectedMonthName = months[$("#datepicker").datepicker('getDate').getMonth()]; A more complicated but more customizable way would be to use a formatter (my comment). Then see this question and answer . Edit: I

Hiding a datepicker using jQuery

做~自己de王妃 提交于 2019-12-05 16:37:02
I am using struts2 jquery plugin s datepicker as below <sj:datepicker id="frdate" name="training.fromDate" label="From Date (dd-mm-yyyy)" maxDate="0" /> I want to hide this on certain coditions.I have written a jquery like this. $("#frdate").hide(); //this will hide textbox of datepicker $("label[for='frdate']").hide(); // this will hide label of datepicker But datepicker button still showing? How to hide it using jquery? The generated html code is: <tr> <td class="tdLabel"> <label for="frdate" class="label">From Date (dd-mm-yyyy):</label></td> <td><input type="text" name="training.fromDate"

jQuery UI Datepicker weird behavior

最后都变了- 提交于 2019-12-05 13:57:50
I'm having a weird problem while working with a simple datepicker using jqueryUI. I simply want to show a two month calendar with LAST month and current month. I used this code: $(function () { $('#picker').datepicker({ numberOfMonths: 2, showCurrentAtPos: 1, dateFormat: "yy-mm-dd", onSelect: function () { $('#out').html(this.value); } }); }); <div id="picker"></div> <output id="out"></output> It displays what I want but with an strange behavior as you can check here: http://jsfiddle.net/xgvargas/UCbxf/ When you select a date it jumps to other month and, in some cases, the selected date is no

jQueryUI datepicker behavior when open during ASP.NET partial postback: year becomes 1899 or 1900

荒凉一梦 提交于 2019-12-05 11:00:19
I've got a very interesting bug with a jQueryUI datepicker and an UpdatePanel where the datepicker's chosen date is about 100 years off. jQuery is version 1.6.2, and jQueryUI is version 1.8.14. Here's the rough layout: <asp:UpdatePanel ID="myUpdatePanel" runat="server"> <ContentTemplate> <asp:DropDownList ID="myDdl" runat="server" AutoPostBack="true"> <asp:ListItem Value="foo" Text="Foo" /> <asp:ListItem Value="bar" Text="Bar" /> </asp:DropDownList> <asp:TextBox ID="myText" runat="server" CssClass="dateText" /> </ContentTemplate </asp:UpdatePanel> <script type='text/javscript'> $(document)

Referencing a Bootstrap icon within jQuery datepicker buttonImage attribute?

半世苍凉 提交于 2019-12-05 10:31:35
What value should I be using for the jQuery datepicker buttonImage attribute? I would like to use the Bootstrap calendar icon with the jQuery datepicker. I can use the icon image in the html page when referenced like this: <i class=icon-calendar></i> When I use the angular-ui wrapper ui-date to wrap the jQuery datepicker: <div class="control-group"> <label class="control-label" for="startDate">Start Date</label> <div class="controls"> <input class="span2" id="startDate" type="text" data-ng-model="formModel.startDate" data-ui-date="formModel.datePickerOptions" data-ng-change="formModel

jQuery Datepicker onClose select next

♀尐吖头ヾ 提交于 2019-12-05 09:42:24
I have a system where people can add multiple from and to dates ie screenshot: On selecting the first date the onClose event sets the date for second input and opens it. IE datePickers = function() { $(".from_date").datepicker({ minDate: 'D', dateFormat: "dd/mm/yy", defaultDate: "+1w", numberOfMonths: 2, onClose: function(selectedDate) { $(".to_date").datepicker("option", "minDate", selectedDate); return $(".to_date").datepicker("show"); } }); return $(".to_date").datepicker({ minDate: '+1D', dateFormat: "dd/mm/yy", defaultDate: "+1w", numberOfMonths: 2 }); }; My problem becomes when I have 2

jQuery Date Picker - TimeZone Issue

[亡魂溺海] 提交于 2019-12-05 08:09:57
We are using a jQuery date picker on our website to select dates and times for bookings. The calendar is currently set at PST and this causes bugs when users try to access from other timezones. Should we set the server to be UTC and have the application automatically select user's timezone based on their IP Address. I was curious as whether we would also have to include manual selection as automatic selection may fail (i.e. when user works through proxy). Any advice would be greatly appreciated. Vik David The user already selects their timezone which is in their OS settings. Use javascript to

how to disable already booked dates?

喜欢而已 提交于 2019-12-05 07:45:54
I am having a form for booking hotel rooms where in I am having two fields called checkIn and checkOut. I am using jQuery datepicker for booking rooms here I don't want to show those dates which are already booked. I have tried like this. $(function() { var excludedCheckInDates = CHECKINDATES; // an array of already booked checkin dates var excludedCheckOutDates = CHECKOUTDATES; // an array of already booked checkout dates $.datepicker .setDefaults({ defaultDate: '+1w', changeMonth: true, changeYear: true, minDate: 0, beforeShowDay: function(date) { date = $.datepicker.formatDate('yy-mm-dd',

Contact form 7 Datepicker, date range between 2 dates

六月ゝ 毕业季﹏ 提交于 2019-12-05 07:21:56
问题 I would like to have two date field in my Wordpress contact form 7. A start-date and an end-date. The fields will be datepickers from the "Contact Form 7 Datepicker" plugin. When visitor has selected a start-date he should only be able to select an end date that is 4 days later then the start-date. How can I achieve this by only using the "contact form 7" form creator? 回答1: This is the syntax I put in the "contact form 7". Start date charter*: [date* date-start date-format:MM_d_yy] End date

jQuery Date Picker Doesn't Show Original Text Value

谁说胖子不能爱 提交于 2019-12-05 06:05:26
I'm using jQuery's Date Picker for one of my form's field - Date of Birth. The field is generated using PHP and will be populated with the user's original date of birth. Clicking the field brings up the widget, which it does perfectly fine. However, the textbox doesn't show the original value, even though it appears in the browser's source code. I'm using Google Chrome. The following is the jQuery code: $(function() { $("#DatePicker").attr("readonly","readonly"); $("#DatePicker").datepicker({ changeMonth: true, changeYear: true, yearRange: "1950:+10" }); $("#DatePicker").datepicker("option",