jquery-ui-datepicker

jQuery datepicker in Symfony2 gives 'This value is not valid.'

断了今生、忘了曾经 提交于 2019-12-05 04:15:55
I added a jQuery datepicker in my symfony2 form. twig file: $('.date').datepicker({ showOn: 'button', buttonImageOnly: true, changeMonth: true, changeYear: true, dateFormat: 'yy-MM-dd ', yearRange: "-0:+1" }); PostType.php $builder->add('toDate','datetime',array( 'input' => 'datetime', 'widget' => 'single_text', 'format' => 'yy-MM-dd', 'attr' => array('class' => 'date') )); I tried several date formats. But I always get This value is not valid. when I submit. I tried to get the form errors, but it doesn't give any more information. try something like this $('.date').datepicker({ showOn:

Date validator on DatePicker trigger false negatives in IE7/IE8

女生的网名这么多〃 提交于 2019-12-05 03:46:28
I have some basic validation on a form which includes two jQuery UI DatePickers. The format of the date is yy-mm-dd. There is a required and date validation on both DatePickers. These work as expected in Chrome & FF, but trigger false negatives (valid input is said to be invalid) in IE7/IE8. Date picker setup: $('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' }); This is unrelated but I figured I would include, just in case: $.validator.addMethod("endDate", function(value, element) { var startDate = $('#startDate').val(); return Date.parse(startDate) <= Date.parse(value); }); The actual

jquery ui datepicker force non-inline (popup) mode on span or div

心已入冬 提交于 2019-12-05 03:32:12
问题 I am attaching datepicker to a span but I want the popup style and functionality that you get from attaching to an input. I can change the css to position:absolute, but the datepicker does not close on escape, blur, select, etc. Do I have to manually handle the popup functionality (such as closing the datepicker) or is there a way to disable inline mode? script //Inline Editing: Dates $('.date span').live('click', function () { var $date = $(this); $date.datepicker({ onSelect: function (val,

jQuery UI Datepicker Inline - submiting form on click

我怕爱的太早我们不能终老 提交于 2019-12-05 03:29:45
问题 I am trying to submit form when date is clicked on datepicker. I have managed to submit, but cannot pass chosen date to hidden field of the form. So, form submits, but date is not sent ( I am sure it must be simple to do, but I am not experienced with js, so any help is appreciated. Here's the code: <script type="text/javascript"> $(document).ready($(function(){ var $hiddenInput = $('#hiddenFieldID'); $('#datepicker').datepicker({ inline: true }) .bind('click', function(){ $('#myFormID')

multiple datepicker in same page not working javascript

筅森魡賤 提交于 2019-12-05 02:43:05
I used add row delete row functionality in my form. I have a date field with date picker functionality. The problem is if i add more than one row and then click date picker it is not working properly. Please see this http://jsfiddle.net/KN7Hd/ for demo. $(function() { $( "#datepicker" ).datepicker({ showOn: "button", buttonImage: "images/calendar.png", buttonImageOnly: true, showOtherMonths: true, selectOtherMonths: true }); }); How to fix this? Take a look in below example: http://jsfiddle.net/fMD62/ <input type="text" class="datepick" id="date_1" /> <input type="text" class="datepick" id=

Jquery datepicker change event trigger and input's default change event

◇◆丶佛笑我妖孽 提交于 2019-12-05 00:39:33
I have datepicker <input type='text' class='inp'> <script> $('.inp').datepicker(); $(".inp").on("change",function (){ console.log('inp changed'); }); </script> When I first change '.inp' manually type there a value, then immediately I click on datepicker's opened calendar. I get two 'change' event listeners. First from manual change, then from datepicker change. How can I avoid this? Set your input readOnly , it will help you to change the value of field through icon only. <input type='text' class='inp' readOnly /> then use onSelect to get selected date, as following: $(function() { $(".inp")

Hide ui-datepicker-calendar based on element attribute

二次信任 提交于 2019-12-04 19:00:37
问题 I have multiple inputs on my page, all of which have jQuery UI's datepicker widget attached to them. What I would like to do is show/hide the .ui-datepicker-calendar based on a data-calendar attribute on the input element. For example: <input type="text" data-calendar="false" /> <input type="text" data-calendar="false" /> <input type="text" data-calendar="true" /> So, the first two should not show the .ui-datepicker-calendar , but the last should. I thought I could leverage the beforeShow

jQuery UI Picking a start and end date within range based on start date

假如想象 提交于 2019-12-04 17:48:13
问题 I'm building a date picker in jQuery ui. What I'm trying to do is set a range, so when they pick the first date the second date appears and gives a 30 day window. I tried this but it doesn't work (it lets the user pick 30 days from today, not 30 from the start date): var pickDate; $( "#datepickerEnd" ).hide(); $( "#datepickerStart" ).datepicker(); $( "#datepickerStart" ).change(function(){ var pickDate = $( "#datepickerStart" ).val(); $( "#datepickerEnd" ).datepicker({ minDate: pickDate,

jQuery UI datepicker: How to change the month names in the drop-down from short to long names?

白昼怎懂夜的黑 提交于 2019-12-04 17:05:17
问题 I need to change the month names from short names to long names in my jQuery UI datepicker. My properties are: $.datepicker.regional['de'] = { prevText: '<zurück', nextText: 'vor>', monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag'

Create a label using jQuery on the fly

扶醉桌前 提交于 2019-12-04 16:26:51
问题 I need to create a label and text field on the fly and also include datepicker for the textfield. I need something like this: <label for="from">From </label> <input type="text" id="from" name="from" /> I have tried something like this in jQuery: var label = $("<label>").attr('for', "from"); label.html('Date: ' + '<input type="text" id="from name="from" value="">'); $(function() { $("#from").datepicker(); }); This one somehow doesn't create the label and also the text field. I am not sure what