Show a compact year-less date in the day bar so it fits small iPhones

The native date input can't be told to drop the year, so a button face
shows e.g. "Jul 10" and the real input sits hidden behind it, still
holding the value and opening the native picker on tap.
This commit is contained in:
Alexander Heldt
2026-07-15 09:41:44 +00:00
parent cdd701f0b4
commit b608dfc342
4 changed files with 39 additions and 4 deletions
+7 -1
View File
@@ -86,7 +86,13 @@
<span id="bar-clock-time"></span>
</div>
<button type="button" id="day-prev" class="ghost" aria-label="Previous day"></button>
<input type="date" id="day-picker" />
<!-- A browser won't let us shorten the text a native date input shows,
so the face button carries a compact year-less date and the real
input stays (visually hidden) as the value + native picker. -->
<span class="day-date">
<button type="button" id="day-date-face" class="ghost"></button>
<input type="date" id="day-picker" tabindex="-1" aria-hidden="true" />
</span>
<button type="button" id="day-next" class="ghost" aria-label="Next day"></button>
<button type="button" id="day-today" class="ghost">Today</button>
</section>