Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable native datepicker in Google Chrome

Date picker landed on Chrome 20, is there any attribute to disable it? My entire system uses jQuery UI datepicker and it's crossbrowser, so, I want to disable Chrome native datepicker. Is there any tag attribute?

like image 777
Alexandre Avatar asked Jul 03 '12 23:07

Alexandre


2 Answers

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; } 
like image 77
Yacine Zalouani Avatar answered Sep 27 '22 18:09

Yacine Zalouani


If you have misused <input type="date" /> you can probably use:

$('input[type="date"]').attr('type','text');

after they have loaded to turn them into text inputs. You'll need to attach your custom datepicker first:

$('input[type="date"]').datepicker().attr('type','text');

Or you could give them a class:

$('input[type="date"]').addClass('date').attr('type','text');
like image 44
rjmunro Avatar answered Sep 27 '22 18:09

rjmunro