jquery-ui-datepicker

How do I format date in jQuery datetimepicker?

青春壹個敷衍的年華 提交于 2019-11-27 19:41:12
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 Skilldrick Here you go . $('#timePicker').datetimepicker({ // dateFormat: 'dd-mm-yy', format:'DD/MM/YYYY HH:mm

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

不羁岁月 提交于 2019-11-27 17:11:59
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'], input[id$='dpTo']"); // #clearDates is a button to clear the datepickers $('#clearDates').on('click',

jQuery UI Datepicker - onSelect get the selected date +3 days

江枫思渺然 提交于 2019-11-27 17:01:51
问题 I try to create a date range by using the jQuery UI datepicker, using two text fields. The first text field "start_date" will set the start date and the second text field "end_date" will set the end date. The code I have till now is this: $('#start_date').live( 'focus', function() { $('#end_date').datepicker( { dateFormat: 'dd MM yy', minDate: new Date(), maxDate: new Date(2012, 9, 15), stepMonths: 2, numberOfMonths: 2 } ); $(this).datepicker( { dateFormat: 'dd MM yy', minDate: new Date(),

jQuery ui datepicker conflict with bootstrap datepicker

非 Y 不嫁゛ 提交于 2019-11-27 14:45:29
I want to show two months using bootstrap datepicker. After search on google I am not able to find how to show multiple months using bootstrap datepicker. I found that I can use JQuery UI for displaying multiple months. But problem is: In my application they are using bootstrap date picker. When I am trying to use JQuery UI datepicker then Bootstrap datepicker override it and I am not able to see JQuery UI datepicker. Could you please suggest how to replace bootstrap datepicker to JQuery UI? I wanted to achieve this: http://jqueryui.com/datepicker/#multiple-calendars This issue can be solved

JQuery datePicker date reset

試著忘記壹切 提交于 2019-11-27 13:55:13
问题 I would like to add a "Reset" control to the datepicker at the bottom of the calendar - where the "close" control goes. This would enable the user to reset the input tied to datepicker to blank (no date). I can't figure out how to write the bind function, specifically, how do I get a hold of the element bound to the control? if (this.displayClear) { $pop.append( $('<a href="#" id="dp-clear">' + $.dpText.TEXT_CLEAR + '</a>') .bind( 'click', function() { c.clearSelected(); //help! reset the

How to set minDate to current date in jQuery UI Datepicker?

隐身守侯 提交于 2019-11-27 13:24:27
This is my code and it is not working correctly. I want to set minDate to the current date. How can I do it? $("input.DateFrom").datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', maxDate: 'today', onSelect: function(dateText) { $sD = new Date(dateText); $("input#DateTo").datepicker('option', 'minDate', min); } You can specify minDate as today by adding minDate: 0 to the options. $("input.DateFrom").datepicker({ minDate: 0, ... }); Demo : http://jsfiddle.net/2CZtV/ Docs : http://jqueryui.com/datepicker/#min-max You can use the minDate property, like this: $("input

jquery datepicker not working on dynamically created html

荒凉一梦 提交于 2019-11-27 12:59:38
问题 I'm creating dynamically a couple of div with inner controls. Two of those controls should be datepickers. But for some reason they are not showing (only input text are shown) It works if I create static html, but not when I'm using dynamic one. This is the code I'm using to generate the HTML (I can see the div) var ShowContainerDiv = document.createElement('DIV'); var btnShowDiv = document.createElement('DIV'); btnShowDiv.id = 'btnShowDiv '; btnShowDiv.title = 'Change'; btnShowDiv.index =

ipad web application: How do I prevent the keyboard from popping up on jquery datepicker

允我心安 提交于 2019-11-27 11:28:12
I have a form with an date field with a jquery datepicker attached to it. When I select the date field the datepicker pops up but then the iPad keyboard slides into view and obscures the datepicker. How do I prevent the keyboard from popping up in this situation? I used a slightly modified version of Rob Osborne's solution and it successfully prevented the keyboard from popping up on the iPad and iPhone. $(".datePicker").datepicker({ showOn: 'button', onClose: function(dateText, inst) { $(this).attr("disabled", false); }, beforeShow: function(input, inst) { $(this).attr("disabled", true); } })

Disable future dates in jQuery UI Datepicker

戏子无情 提交于 2019-11-27 11:04:52
Is it possible to disable future date from today? Let say today is 23/10/2010, so 24/10/2010 onwards are disabled. Sorry I am very new in jQuery and JavaScript. Cyril Gupta Yes, indeed. The datepicker has the maxdate property that you can set when you initialize it. Here's the codez $("#datepicker").datepicker({ maxDate: new Date, minDate: new Date(2007, 6, 12) }); $(function() { $("#datepicker").datepicker({ maxDate: '0'}); }); JAY Code for Future Date only with disable today's date. var d = new Date(); $("#delivdate").datepicker({ showOn: "button", buttonImage: base_url+"images/cal.png",

Set today's date as default date in jQuery UI datepicker [duplicate]

元气小坏坏 提交于 2019-11-27 10:14:01
问题 This question already has an answer here: How do I pre-populate a jQuery Datepicker textbox with today's date? 19 answers I just want today's date to be the default value in the input that is using jQuery UI's datepicker : <input id="mydate" type="text" /> I tried the below code but it didn't work: var currentDate = new Date(); $("#mydate").datepicker("setDate",currentDate); 回答1: You need to make the call to setDate separately from the initialization call. So to create the datepicker and set