jquery-ui-datepicker

jQuery Datepicker that supports multiple formats

谁说胖子不能爱 提交于 2019-11-26 21:21:36
问题 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

Disable setting of focus for jQuery UI datepicker

≡放荡痞女 提交于 2019-11-26 20:51:48
问题 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

Jquery DatePicker Set default date

筅森魡賤 提交于 2019-11-26 20:49:25
问题 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. 回答1:

jQuery datepicker validation message issue

半城伤御伤魂 提交于 2019-11-26 20:27:39
问题 I'm using the jquery datepicker plugin at http://plugins.jquery.com/project/datepick with the datepicker validation plugin. <script id="frmValidation" type="text/javascript"> $(document).ready(function(){ var validator = $("#frmTest").validate({ rules:{ fname: "required", dobPicker: "required" }, messages:{ fname: "Please enter a name", dobPicker: "Select a date" }, }); $('#dobPicker').datepick(); $.datepick.setDefaults({showOn: 'both', dateFormat: 'dd-mm-yy', yearRange:'1900:2010'}); }); <

How do I format date in jQuery datetimepicker?

北战南征 提交于 2019-11-26 19:57:50
问题 I use jQuery datetimepicker which was extended from jQuery datepicker to pick not only date but time too. I want to set date/time format this way: dd-mm-yyyy @ hh:mm $('#timePicker').datetimepicker({ dateFormat: 'dd:mm:yyyy', separator: ' @ ', minDate: new Date() }); But this does not work. I get date/time in following format: Thu Jan 27 2011 02:05:17 GMT+0100 Is there any javascript function to format this date/time? If not how do I do that using the plugin? Check out my code: FIDDLE 回答1:

jQuery DatePicker with today as maxDate

谁都会走 提交于 2019-11-26 19:40:24
问题 I would like to set today's date as a maxdate for jQuery datepicker in order to prevent users from picking date greater than today's date 回答1: $(".datepicker").datepicker({maxDate: '0'}); This will set the maxDate to +0 days from the current date (i.e. today). See: http://api.jqueryui.com/datepicker/#option-maxDate 回答2: http://api.jqueryui.com/datepicker/#option-maxDate $( ".selector" ).datepicker( "option", "maxDate", '+0m +0w' ); 回答3: If you're using bootstrap 3 date time picker, try this:

How do I clear/reset the selected dates on the jQuery UI Datepicker calendar?

不羁岁月 提交于 2019-11-26 18:56:10
问题 How do I reset the datepicker calendar values?.. The min and max date restrictions? The problem is that when I clear the dates (by deleting the textbox values), the previous date restrictions are still applied. I've been sorting through the documentation and nothing jumped out as a solution. I also wasn't able to find a quick fix on a SO/google search http://jsfiddle.net/CoryDanielson/tF5MH/ Solution: // from & to input textboxes with datepicker enabled var dates = $("input[id$='dpFrom'],

How do I localize the jQuery UI Datepicker?

落花浮王杯 提交于 2019-11-26 18:23:38
I really need a localized dropdown calendar. An English calendar doesn't exactly communicate excellence on a Norwegian website ;-) I have experimented with the jQuery DatePicker , their website says it can be localized, however that doesn't seem to work. I am using ASPNET.MVC, and I really want to stick to one javascript library. In this case jQuery. The ajax toolkit calendar would be acceptable, if only it too would display Norwegian names. Update: Awesome! I see I am missing the language files, a not so minor detail :-) max4ever For those that still have problems, you have to download the

Jquery Date picker Default Date

冷暖自知 提交于 2019-11-26 17:46:23
问题 I am using a Jquery Datepicker in my project. The problem is that it is not loading the current date, but showing a date 1st January 2001 as default. Can you please let me know how the default date can be corrected so it will display the current date. 回答1: interesting, datepicker default date is current date as I found, but you can set date by $("#yourinput").datepicker( "setDate" , "7/11/2011" ); don't forget to check you system date :) 回答2: Use the defaultDate option $( ".selector" )

Jquery datepicker restrict dates in second date field based on selected date in first date field

点点圈 提交于 2019-11-26 17:45:58
I am using Jquery date picker and I have the following code where when user selects a date, the field below is populated with date +1 $('#dt2').datepicker({ dateFormat: "dd-M-yy" }); $("#dt1").datepicker( {dateFormat: "dd-M-yy", minDate: 0, onSelect: function(date){ var date2 = $('#dt1').datepicker('getDate'); date2.setDate(date2.getDate()+1); $('#dt2').datepicker('setDate', date2); I would like to restrict dates in dt2 field which should not be below the date in dt1 field. E.g. If date selected in dt1 is 01-May-2013 , then user is allowed to pick date after 01-May-2013 , not less than 02-May