jquery-ui-datepicker

How to change the cell color of a jquery datepicker

荒凉一梦 提交于 2019-11-28 01:17:34
I have a jquery datepicker and I need to be able to change the background color for the selected cell date. I'm trying with something like: $("#fecha").datepicker({ onSelect: function(value, date) { alert(date.css()); } }); hoping that the date parameter refers to the selected cell, but it doesn't seem to work. Any suggestion? //Edit: The solution should let me have different cells with different colors set dynamically, this is why I'm trying with onSelect instead of changing the CSS directly. The purpose is to have a calendar with events established by the user. Thanks in advance. dan

jQuery datepicker's dateFormat - how to integrate with .NET current culture DateTimeFormat

故事扮演 提交于 2019-11-28 01:14:03
问题 I'm using jQuery's datepicker plugin in .NET ASP MVC3 intranet application. User that use application have offices in different countries and different locale. This is why I wanted to integrate Thread.CurrentThread.CurrentCulture.DateTimeFormat with jQuery datepicker plugin . My first solution was to create helper extension method: public static string jQueryDatePickerFormat(this HtmlHelper helper) { return Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern; } and set

jQuery Datepicker that supports multiple formats

六月ゝ 毕业季﹏ 提交于 2019-11-27 23:10:19
I'm wondering if anyone can suggest a plugin or solution that would allow me to use the jQuery datepicker plugin with multiple input date formats at the same time. This would allow the user to enter the date in any of the specified formats. I.e.: 3 31 10 3/31/2010 3-31-10 I don't really care if the value gets mangled to one of the specific formats after the user tabs out. A good input masking plugin might work for my purpose too, however, this popular one seems to expect a fixed cardinality for each of the fields, which won't work because I want the user to be able to enter 3 or 03 for the

Jquery DatePicker Set default date

帅比萌擦擦* 提交于 2019-11-27 22:44:44
I Have two date fields where I use DatePicker to pick the dates. For the first date field, I want today's date as the default date. For the second date field, I need today + 15 days as my default date jQuery $("[name=trainingStartFromDate]").datepicker({ dateFormat: 'dd-mm-yy', changeYear: true}); $("[name=trainingStartToDate]").datepicker({ dateFormat: 'dd-mm-yy', changeYear: true}); How do I set the default dates? I have tried setDate: new Date() for first date but it's not working. Today date: $( ".selector" ).datepicker( "setDate", new Date()); // Or on the init $( ".selector" ).datepicker

.datepicker('setdate') issues, in jQuery

狂风中的少年 提交于 2019-11-27 22:40:29
I have a function that executes a query to get some data based on a certain date range which is selected using .datepicker(). I am trying to set the datepicker's that are in the response data back to the date range which was selected before the query was executed. queryDate = '2009-11-01'; $('#datePicker').datepicker('setDate', queryDate); has the interesting result of setting the datepicker to today's date! I wouldn't be so confused if it just spit out an error. Why does it set it to today's date? How can I take the date which is formated like, 'yyyy-mm-dd' and set the datepicker to it? I am

Disable setting of focus for jQuery UI datepicker

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 22:00:36
There is an option with the jQuery UI datepicker to only open the datepicker when a button image is clicked. See the following for an example: http://jqueryui.com/demos/datepicker/#icon-trigger The problem is that the focus is in the textfield as soon as the datepicker opens. Is it possible to disable the setting of the focus? When using a page like the above on a mobile device like an iPhone, the keyboard pops up because the textfield gains the focus. This is not really userfriendly since you have to close the keyboard to actually get to the datepicker and use it... set input to ReadOnly

ASP.NET MVC datetime culture issue when passing value back to controller

丶灬走出姿态 提交于 2019-11-27 21:18:27
How can i tell my controller/model what kind of culture it should expect for parsing a datetime? I was using some of this post to implement jquery datepicker into my mvc application. When i submit the date it gets "lost in translation" i'm not using the US formatting for the date, so when it gets sent to my controller it simply becomes null. I have a form where the user chooses a date: @using (Html.BeginForm("List", "Meter", FormMethod.Get)) { @Html.LabelFor(m => m.StartDate, "From:") <div>@Html.EditorFor(m => m.StartDate)</div> @Html.LabelFor(m => m.EndDate, "To:") <div>@Html.EditorFor(m => m

getDate with Jquery Datepicker

爷,独闯天下 提交于 2019-11-27 20:38:51
i am trying to get date from my implementation of jquery date picker, add it to a string and display the resulting image in my div. Something however is just not working. Can anyone check out the code and have a look at it? The code is supposed to take the date from date picker, combine it in a string which is to have the necessary code to display tag, images are located in /image and in the format aYY-MM-DD.png, new to this date picker and can't quite get it down yet. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link type="text/css" href="css/ui

Jquery UI Datepicker not displaying

北战南征 提交于 2019-11-27 20:28:12
UPDATE I have reverted back to Jquery 1.3.2 and everything is working, not sure what the problem is/was as I have not changed anything else apart of the jquery and ui library versions. UPDATE END I having an issue with the JQuery UI datepicker . The datepicker is being attached to a class and that part is working but the datepicker is not being displayed. Here is the datepicker code I am using and the inline style that is being generated when I click in the input box that has the class ".datepicker". $('.datepicker').datepicker({dateFormat:'dd/mm/yy'}); display:none; left:418px; position

Remove Datepicker Function dynamically

三世轮回 提交于 2019-11-27 20:01:23
I want to remove datepicker function depending on the dropdownlist selected value. I try the following codes, but it still shows the calendar when I put the cursor in the text box. Please give me a suggestion. $("#ddlSearchType").change(function () { if ($(this).val() == "Required Date" || $(this).val() == "Submitted Date") { $("#txtSearch").datepicker(); } else { $("#txtSearch").datepicker("option", "disabled", true); } }); You can try the enable/disable methods instead of using the option method: $("#txtSearch").datepicker("enable"); $("#txtSearch").datepicker("disable"); This disables the