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:
+16
-3
@@ -147,10 +147,23 @@ body::before {
|
||||
flex-wrap: nowrap;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
.day-bar input[type="date"] {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
/* The face button shows the short date; the real input sits invisibly behind
|
||||
it so its native picker still anchors here (and .showPicker() has a target). */
|
||||
.day-date {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
}
|
||||
.day-date input[type="date"] {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
#day-date-face {
|
||||
font-variant-numeric: tabular-nums;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.day-bar button {
|
||||
padding: 8px 10px;
|
||||
|
||||
Reference in New Issue
Block a user