New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x] Change Time fieldtype from text to time input type #9662
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes, thanks!
There are a couple of issues:
The new width of the time portion makes the date get cut off when used in a sidebar.
In Firefox the time is cut off:
I've only checked this out on Safari, Chrome, and Firefox on a Mac.
Do you know how to change to 24 hour time? Apparently it reads your system settings, but even when I tell my Mac to display 24 hours, the field doesn't change. Were you able to test that?
Swapping margin for gap and removing the hardcoded width values ensures the input field is more consistent across different browser versions and device widths
Hey @jasonvarga, thanks a bunch! Couple updates for you:
Yeah, the 24-hour config varies a bit by browser. What winds up working most consistently across browsers is if your OS language defaults to a 24-hour time and you perform a restart. When I set my macOS language to "English (UK)" and restart my browser I get the 24-hour time format.
Good catch! I made a handful of CSS changes that should make the date, date + time, and date + time + seconds look more consistent in a sidebar and content area context: |
# Conflicts: # resources/js/components/fieldtypes/DateFieldtype.vue
Confirmed. Kinda stupid though. Even if I set 24 hour time in my Mac settings (pictured), it doesn't respect it. I have to use the entire alternate locale and reboot like you said. Not a fault of this PR obviously. Thanks! |
Thanks so much, @jasonvarga! Yeah, such a peculiar setting! |
This pull request changes the Time fieldtype to use
<input type="time">
instead of<input type="text">
. This is valuable for a couple reasons: