jquery-ui-datepicker

Cloning datepicker objects [JQuery]

牧云@^-^@ 提交于 2019-11-29 18:56:08
问题 I have an input field that I define as a datepicker through a css class. I now want to clone this input field and have it so the cloned inputs are also datepickers. After reading from various sources I was lead to believe that the following code should work but it doesn't. I was hoping maybe someone could help me figure out what I was doing wrong :) <input type="text" id="date" name="date" class="calendar" /> <input type="button" id="clone" name="clone" value="Clone dates" /> And here's the

altFormat not working in jQuery datepicker input field

最后都变了- 提交于 2019-11-29 16:58:17
问题 I have date field (id begin-date) $( "#begin-date" ).datepicker({ minDate: -20, maxDate: "+1M +10D", dateFormat: "yy-mm-dd", altFormat: "yymmdd" }); On post, it prints the format as yy-mm-dd (2010-12-08), when it should print as yymmdd (20101208) Any ideas of why it is not posting it properly with altFormat set? input field rendered: <input type="text" name="begin_date" id="begin-date" class="validate[required]" value="" /> 回答1: The altFormat option doesn't control the formatting of the input

Highlight current week when datepicker is loaded

萝らか妹 提交于 2019-11-29 16:56:10
I am following this jsFiddle to be able to highlight and select whole week from datepicker. I have customized it to work with jQuery 1.9 by changing .live() to .on() . Here is the edited jsFiddle . It works fine but in its current state the week is only highlighted once the user click on a date. What I want to achieve is to highlight (and populate dates in startDate and endDate vars) the week to which current date belongs automatically on startup without clicking current date. I have tried the following but it doesn't seem to work var currentDate = $(".week-picker").datepicker("getDate"); var

Manual date entry validation for jQuery UI Datepicker maxDate option

核能气质少年 提交于 2019-11-29 13:49:49
问题 I have jQuery datepicker on a page that needs to allow manual entry of the date, but also needs to validate that the date is no more than one day ahead. The picker control has been limited via the maxDate, but when one manually enters the date, they can enter a date more than one day ahead. How does one (me) stop that? Here is what I have so far: $(".datepicker").attr("placeholder", "mm-dd-yyyy").datepicker({ showOn: "button", maxDate: "+1", showOtherMonths: true }); 回答1: Well, the above

Rails 4 + simple_form and jQuery UI. Datepicker is not working via turbolinks

こ雲淡風輕ζ 提交于 2019-11-29 13:05:46
问题 I have this form which calls datepicker: ... <%= f.input :expiration_date, as: :datepicker, required: false %> ... Simple_form wrapper: app/inputs/datepicker_input.rb class DatepickerInput < SimpleForm::Inputs::Base def input @builder.text_field(attribute_name, input_html_options) + \ @builder.hidden_field(attribute_name, { :class => attribute_name.to_s + "-alt"}) end end When the page is loaded from scratch ( $(document).ready event ), the following html is generated: <input class=

Where are the i18n files of jQuery UI datepicker >= 1.11.0

牧云@^-^@ 提交于 2019-11-29 11:37:57
问题 I downloaded jQuery UI from a custom build (http://jqueryui.com/download) and from http://jqueryui.com/download/all/... but the folder i18n is no longer present. The Localization section of the docs still mention the files with the old filenames (like in 1.10): Each localization is contained within its own file with the language code appended to the name, e.g., jquery.ui.datepicker-fr.js for French. I found the files in GitHub, with the new filenames ( datepicker-fr.js instead of jquery.ui

How to combine the jQueryUI DatePicker's Icon Trigger with Bootstrap 3's Input Groups

♀尐吖头ヾ 提交于 2019-11-29 09:56:17
jQueryUI has a nice DatePicker with icon trigger (a calendar icon opens the calendar, similar behaviour to Outlook). On the other hand, Bootstrap 3's Input Groups are really nice for connecting icons to input fields. Can the two be combined without rewriting either one? I have made a JSFiddle here . For the «Start Date» the jQueryUI icon trigger is not active. For the «End Date» it is enabled. The DatePicker icon, unfortunately, appears outside of the End Date's Input Group: So, is it possible to enable the Icon Trigger as part of the Input Group (looking like «Start Date» but behaving like

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

流过昼夜 提交于 2019-11-29 07:25:44
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 dateFormat option in javascript like this: $("#StartDate").datepicker({ dateFormat: '@Html

jQuery UI Datepicker - allow only certain weekdays

跟風遠走 提交于 2019-11-29 06:54:34
I'm using jquery UI datepicker on a huge project and I realize now that I'll need to allow only certain weekdays on some areas. I read their documentation and didn't find anything about it.. I know that there are some datepickers scripts for jq which can do this but I don't want to use any additional script for this if it's possible. Anyone know any workaround for this? Maybe I'm misunderstood anything in their documentation? NOTE: example of desired behaviour: http://codeasp.net/blogs/raghav_khunger/microsoft-net/1088/jquery-datepicker-disable-specific-weekdays Thanks in advance for help,

Display additional text alongside dates in jQuery UI datepicker

家住魔仙堡 提交于 2019-11-29 05:34:05
问题 I am using jQuery UI datepicker and I want to display additional text inside date cells next to the date. This is the desired behavior: Unfortunately, manipulating date cells using .text() and .html() functions breaks the datepicker functionality. See following demo and try to use the datepicker. Notice that when you select a date (i) the custom text is gone (ii) changing months destroys the calendar and lands you on "undefined NaN" month: https://jsfiddle.net/salman/aLdx4L0y/ Is there a