I want to make a custom datepicker that looks the same in all major desktop browsers. I use jquery-ui for that, managed to disable native datepicker in Chrome but I can't find any way how to do it in Opera.
Asked
Active
Viewed 1,259 times
3 Answers
2
I know this question is already answered but there is a better solution in this post.
It says:
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;
}

Community
- 1
- 1

fernandosavio
- 9,849
- 4
- 24
- 34
1
Modernizr can be used to check if browser has native datepicker support. If it exists then Jquery UI datepicker can be added :
if (Modernizr.inputtypes.date) {
// add here jquery UI datepicker
}

Bhupendra
- 1,196
- 16
- 39
-
Yes, I'm aware of modernizr, but I wan't to use my custom datepicker in every browser, no matter if it has a native mechanism or not. Thanks for a reply though. – Lutet Jul 10 '14 at 16:36
0
I couldn't find any solution how to disable native opera datepicker, so I decided to change type of the input element from date to text, just after initialisation of jquery-ui datepicker. Thanks to that I've got rid of any other native elements like date spinner or clear button. It works perfectly in all up-to-date browsers.

Lutet
- 1
- 2