This JSP code uses Bootstrap5:
<form action="" method="GET" class="row g-1 mb-3 ">
<div class="col-lg-2 col-md-4 col-6 mb-2">
<input type="date" class="form-control" name="startDate" style="font-size:.9rem">
</div>
<div class="col-lg-2 col-md-4 col-6 mb-2">
<input type="date" class="form-control" name="endDate" style="font-size:.9rem">
</div>
</div>
Here is the view on Desktop :
https://i.sstatic.net/IEEss.png
And this is how it looks on Mobile
https://i.sstatic.net/qjniE.png
This is the way Bootstrap is imported :
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="25474a4a51565157445565100b140b16">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
//code
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9af8f5f5eee9eee8fbeadaafb4abb4a9">[email protected]</a>/dist/js/bootstrap.bundle.min.js" ></script>
The user had read a related answer about date fields but found it impractical. They noted that testing in browser dev tools worked fine for mobile view, indicating the issue occurred only on actual mobile devices.