Disable native datepicker in Google Chrome
To hide the arrow: input::-webkit-calendar-picker-indicator{ display: none; } And to hide the prompt: input[type=”date”]::-webkit-input-placeholder{ visibility: hidden !important; }
To hide the arrow: input::-webkit-calendar-picker-indicator{ display: none; } And to hide the prompt: input[type=”date”]::-webkit-input-placeholder{ visibility: hidden !important; }
You can use event changedate() to keep track of when the date is changed together with datepicker(‘hide’) method to hide the datepicker after making selection: $(‘yourpickerid’).on(‘changeDate’, function(ev){ $(this).datepicker(‘hide’); }); Demo UPDATE This was the bug with autoclose: true. This bug was fixed in latest master. SEE THE COMMIT. Get the latest code from GitHub
If you are still interested in a javascript api to select both date and time data, have a look at these projects which are forks of bootstrap datepicker: Bootstrap Datetime Picker 1 Bootstrap Datetime Picker 2 The first fork is a big refactor on the parsing/formatting codebase and besides providing all views to select date/time … Read more
here is the trick: $(‘body’).on(‘focus’,”.datepicker_recurring_start”, function(){ $(this).datepicker(); }); DEMO The $(‘…selector..’).on(‘..event..’, ‘…another-selector…’, …callback…); syntax means: Add a listener to …selector.. (the body in our example) for the event ..event.. (‘focus’ in our example). For all the descendants of the matching nodes that matches the selector …another-selector… (.datepicker_recurring_start in our example) , apply the event handler … Read more
When you make the input, set it to be readonly. <input type=”text” name=”datepicker” id=”datepicker” readonly=”readonly” />
What version of jQuery-UI are you using? I’ve tested the following with 1.6r6, 1.7 and 1.7.1 and it works: //Set DatePicker to October 3, 2008 $(‘#dateselector’).datepicker(“setDate”, new Date(2008,9,03) );
You should be able to use the readonly attribute on the text input, and jQuery will still be able to edit its contents. <input type=”text” id=’foo’ readonly=’true’>
Note: Fixed as of Lollipop, source here. Automated class for use in clients (compatible with all Android versions) updated as well. TL;DR: 1-2-3 dead easy steps for a global solution: Download this class. Implement OnDateSetListener in your activity (or change the class to suit your needs). Trigger the dialog with this code (in this sample, … Read more
I struggled with a similar problem for hours. It then turned out that jQuery was included twice, once by the program that I was adding a jQuery function to and once by our in-house debugger.
It may not be appropriate… but it helped me. <input placeholder=”Date” class=”textbox-n” type=”text” onfocus=”(this.type=”date”)” id=”date”>