jquery-ui-datepicker

Datepicker onSelect Not Firing

主宰稳场 提交于 2019-12-07 08:12:36
问题 I have a date picker but onClose and onSelect will not fire. The code is in document.ready so i know its initialized. $('#DateRangeTo').datepicker({ beforeShow: function (input, inst) { inst.dpDiv.css({ marginTop: -input.offsetHeight + 'px', marginLeft: input.offsetWidth + 'px' }); }, format: "dd/mm/yyyy", startView: 1, //daysOfWeekDisabled: "3,4", autoclose: true, todayHighlight: true, //onClose: function (dateText, inst) { alert("here"); } onSelect: function (dateText, inst) { alert(

Get month name instead of number

血红的双手。 提交于 2019-12-07 07:37:51
问题 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 )? 回答1: 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

Hiding a datepicker using jQuery

感情迁移 提交于 2019-12-07 07:15:17
问题 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=

jQuery Datepicker - Automatically define altField for all datepickers

浪子不回头ぞ 提交于 2019-12-07 06:03:05
问题 All my datepickers have an automatically-generated hidden field which has the same ID as the datepicker input, but with an underscore prepended. <div class="datepicker"> <input id="MyField1" type="text" value="" /> <input id="_MyField1" type="hidden" value="" /> </div> <div class="datepicker"> <input id="MyField2" type="text" value="" /> <input id="_MyField2" type="hidden" value="" /> </div> And then any field which has class datepicker gets made into a datepicker. $('.datepicker input')

Referencing a Bootstrap icon within jQuery datepicker buttonImage attribute?

最后都变了- 提交于 2019-12-07 05:49:44
问题 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

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

独自空忆成欢 提交于 2019-12-07 05:32:17
问题 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"

jQuery Datepicker onClose select next

我的梦境 提交于 2019-12-07 05:15:38
问题 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',

jQuery Datepicker with FontAwesome Button?

假如想象 提交于 2019-12-07 01:50:52
问题 I'm building a site with Foundation, and I have the FontAwesome icons installed. I'm trying to set up a form where a user can click on an input or a button to see the jQuery datepicker. I'd like to be able to use the FontAwesome icon in the button. But I can't seem to get the button to trigger the datepicker. EDIT: I kind of got it working, but I still can't figure out how to implement the FontAwesome icon. I have this in my HTML: <div class="row"> <div class="large-3 columns"> <label

Correct way to change specific date's cell background-color on datepicker

*爱你&永不变心* 提交于 2019-12-06 15:32:31
I have seen many answers on the line of How to change the cell color of a jquery datepicker But they for some reason do not apply to my example. http://plungjan.name/test/datepicker_orange.html I want the WHOLE cell content to be orange, not just what we can see behind the link IN the cell So what I can see as .ui-state-default { background: url("images/ui-bg_glass_75_e6e6e6_1x400.png") repeat-x scroll 50% 50% #E6E6E6; border: 1px solid #D3D3D3; color: #555555; font-weight: normal; } which controls the link inside the cell with a class name set by me to "orange" <td class=" orange" onclick="DP

jQuery UI datepicker maxdate

99封情书 提交于 2019-12-06 13:09:20
I am in need of having the maxDate for my jQueryUI date picker dynamically update depending on the day. Right now, as you will see below, there is a function being used to disable Monday-Thursday because our team can only report issues Friday-Sunday. So what I need to do is have it so that the team can continue to report on the weekend but not for the next weekend until Thursday. For example, today is Monday, the team can still report on issues from last Thursday-Sunday and won't be able to select a day for next weekend until Thursday. Is this possible? Here is the code I have so far: var