The problem is simple.
<input type="date />
Looks like this on Firefox (desktop and mobile):
The internet only suggests a solution for Chrome:
input {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
}
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
display: none;
-webkit-appearance: none;
}
This does indeed work on Chrome, but not on Firefox.
Nothing I’ve tried works on Firefox.
I am wondering if it’s even possible. I want to hide the calendar icon.
I am aware that on desktop, clicking the calendar is the only way to bring up the date picker. This is not an issue as it is a mobile app.
2
Answers
add this code to css and i hope will be removed
One way you could do it is to overlay a text input box on top of the date picker then use the showPicker() method to trigger the date picker dialog box. Use the
change
event to reflect any changes in the date input to the text input. I’ve not formatted the date but you can use the Intl.DateTimeFormat object to make the date locale friendly.Just a note: This won’t work on codepen or on the snippet editor due to security reasons so to test it you’ll have to drop it onto localhost or your development environment.