jquery-ui-datepicker

Datepicker onSelect to format new date range

半腔热情 提交于 2019-12-25 07:48:36
问题 I have 2 datepickers, one is a fromDate and one is a toDate. I can highlight the range from the fromDate to the toDate successfully in beforeShowDay(), but I need it to highlight when new values are selected. This triggers the onSelect statement. Is there a way to either: 1) trigger the beforeShowDay again? or 2) get all the dates of the new range and apply a css class to them? beforeShowDay: function(date){ if (date >= initialFromDate && date <= initialToDate) { return [true, 'ui-individual

jQuery Datepicker hangs when input field is re-clicked (Chrome)

南楼画角 提交于 2019-12-25 05:32:10
问题 I have this jsFiddle: http://jsfiddle.net/VebTY/ It looks this this is only an issue in chrome. When you click on a an item in the page, it adds a text field, and then a date picker pops up. When you click out of the text box then back into the text box the browser hangs for 5 - 10 seconds. Why is it doing that and how can I fix it? Here is my relevant code: $(document).on("focus", "td input[type=text]", function(e) { e.stopPropagation(); if ($(this).closest("td").attr("data-type") === "date"

jQuery Datepicker hangs when input field is re-clicked (Chrome)

三世轮回 提交于 2019-12-25 05:31:47
问题 I have this jsFiddle: http://jsfiddle.net/VebTY/ It looks this this is only an issue in chrome. When you click on a an item in the page, it adds a text field, and then a date picker pops up. When you click out of the text box then back into the text box the browser hangs for 5 - 10 seconds. Why is it doing that and how can I fix it? Here is my relevant code: $(document).on("focus", "td input[type=text]", function(e) { e.stopPropagation(); if ($(this).closest("td").attr("data-type") === "date"

jQuery change date from format to another one

隐身守侯 提交于 2019-12-25 04:23:11
问题 I have an input text with id CldrFrom It has date like this: 04/17/2014 in other words mm/dd/yyyy I want to change it to this format 17-04-2014 in other words dd-mm-yyyy I want to do that in jQuery. What I have tried var currentDate = $(#CldrFrom").val(); val = val.replace("/", "-"); So I replaced the / with - but I still need to make the day as the first not the month. how please? Edit to take the date I am using a datepicker library. I call it like this: $("#CldrFrom, #CldrTo").datepicker()

How to use Glyphicon instead of datepicker text box

≡放荡痞女 提交于 2019-12-25 02:57:12
问题 PFB the link of plunker . http://jsfiddle.net/jomanlk/7NgpQ/ Here I want to use - <span class="glyphicon glyphicon-calendar" id="full"></span> instead of <input type='text' id='full' name='fulldate'> But if i use glyphicon, calendar is displaying on load only , i want to use it on selecting glyphicon icon only.Any pointers how to proceed on this. 来源: https://stackoverflow.com/questions/28913609/how-to-use-glyphicon-instead-of-datepicker-text-box

Validate an inline jquery Datepicker using jquery validation

瘦欲@ 提交于 2019-12-25 02:18:53
问题 I am trying to ensure that a date has been selected using my inline datepicker.The inline datepicker feeds a hidden input box, so it's tough to require that. To try to get the message to display, I have relocated my error messages using invalidHandler. My code: <script type="text/javascript"> jQuery('#date').datepicker({ inline: true, beforeShowDay: checkDayOfWeek, onSelect: function(dateText, inst) { $("#ship_date").val(dateText); } }); </script> <div id="date" style="font-size: 75%;" class=

jQuery datepicker() - defaulting to yyyy/mm/dd

馋奶兔 提交于 2019-12-25 02:06:32
问题 When I select a date on the datepicker, I need it to default to yyyy/mm/dd When I do the following: $(id).datepicker("option", "dateFormat", 'yyyy/mm/dd'); and select a field, the datepicker does not even come up. Is there anything wrong with what I have above? obviously $(id).datepicker(); work but it does not form that date the way I like it " yyyy/mm/dd 回答1: For formatting use: $("#your_ID").datepicker({dateFormat: "yyyy/mm/dd"}); For getting value of date use this: var date = $("#your_ID"

Highlight specific days of a week in jQuery datepicker

久未见 提交于 2019-12-25 01:45:16
问题 my aim is to highlight specific days of a week in jQuery datepicker. For example I want to highlight Tuesdays and Thursdays. I've seen many examples how to highlight specific dates(see: http://jquerybyexample.blogspot.com/2012/05/highlight-specific-dates-in-jquery-ui.html ). But not a single one that covers my needs. Any hints? 回答1: You could adapt the example you linked, to do what you want, like this: CSS: .Highlighted a{ background-color : Green !important; background-image :none

Excluding dates in the jQuery datepicker using beforeShowDay and an array of objects

旧时模样 提交于 2019-12-25 00:08:47
问题 I have an array of objects, what is the best way to determine if a date is in the array so it cannot be selected in the jQuery date picker. If needed, I can store DateValue as a date. var EventDates = [{"DateID: "1", DateValue: "3/1/2011", FormattedDate: Tue, Mar 1 2011"}, {"DateID: "2", DateValue: "3/2/2011", FormattedDate: Wed, Mar 2 2011"}] $('.juidateicon_ext').datepicker({ showOn: "button", buttonImage: "/Content/images/icons/calendar.gif", buttonImageOnly: true, showOn: 'both',

jQuery DatePicker - dates have to be one day apart, but there's a bug if the start date is tomorrow

会有一股神秘感。 提交于 2019-12-24 22:43:02
问题 I'm using jQuery DatePicker to ensure that a departure date is at least 1 day after an arrival date. I got the code to do this from this question. However, I've just noticed that if I choose tomorrow (31st May 2013) as the arrival date, the departure date gets set to 10th January 2019! But if I pick an arrival date after tomorrow, it seems to work fine. Any ideas on what's going wrong with this? Thanks for any help. Here's a JSFiddle with the code that shows the issue. And here's the JS