<input type="date" placeholder="Date" onfocus="transform(this)" onblur="revert(this)">
<script>
document.querySelector('[type=date]').setAttribute('type','text')
function transform(el){
el.setAttribute('type','date')
}
function revert(el){
if(el.value == '')
el.setAttribute('type','text')
}
</script>
this snippet can help you, it's not actually a solution it's a trick so try other solutions and keep this as your last chance
https://jsfiddle.net/mahdiar_mansouri/zksxe6vc/9/
here is how it works
it just changes input type
on blur and focus events from text to date and reverse
====================================
Updated
this snippet also sets the current time of user machine to the input value as default
document.querySelector('[type=date]').setAttribute('type','text')
function transform(el){
el.setAttribute('type','date');
const [date, time] = formatDate(new Date()).split(' ');
el.value = date;
}
function revert(el){
if(el.value == '')
el.setAttribute('type','text')
}
function formatDate(date) {
return (
[
date.getFullYear(),
padTo2Digits(date.getMonth() + 1),
padTo2Digits(date.getDate()),
].join('-') +
' ' +
[
padTo2Digits(date.getHours()),
padTo2Digits(date.getMinutes()),
].join(':')
);
}
function padTo2Digits(num) {
return num.toString().padStart(2, '0');
}
also the jsfiddle code is updated
https://jsfiddle.net/mahdiar_mansouri/zksxe6vc/16/
Update(based on OP comment
Here is the image and you can see the input[value=""]+label
selector won't select adjacent label because input has value
