Steps to reproduce
- Add a date field to an entity and then go to to that form.
- Fill in an appropriate date.
- Fill in a time that has a single digit hour, like "8:15:00".
- Submit the form and receive a validation message along the lines of
The Start date is invalid. Please enter a date in the format 12:00:00.
The basic problem is that there's a disconnect between the time that you enter in the form and the time that you submit the form. The error message generates a sample based on the current time. This means that if you submit the form between 00:00:00 - 09:59:59, you will get an error message that pretty clearly shows that the hour format is HH
. However, if you submit the form between 10:00:00 - 23:59:59, then the hour would be two digits regardless of whether the hour format is HH
or H
, so it's not as clear that the hour you entered is in the wrong format.
Possible solutions
- Try to use the submitted time (formatted correctly) as the sample time. (i.e.
strtotime()
) - Use a static time for the sample that is between 00:00:00 - 09:59:59.
- Rather than a sample time, show the actual format string.
- Something else I didn't think of. :)
Comment | File | Size | Author |
---|---|---|---|
#15 | Placeholder.png | 93.49 KB | Kumar Kundan |
#12 | Original-Edge_issue.png | 27.86 KB | No Sssweat |
#11 | ie-11-issue.png | 1.89 KB | No Sssweat |
Comments
Comment #2
kevin.dutra CreditAttribution: kevin.dutra at Workday, Inc. commentedWhoops, this is minor.
Comment #3
mpdonadioJust a note that this will only happen on browsers that don't support HTML5 time entry (Firefox and IE11 the last time I checked).
I would got for a combo of 2 and 3, but am interested in a UX perspective here. I would do something like
Comment #5
joyceg CreditAttribution: joyceg commentedokay. So, this is a compatibility issue.
Comment #9
xjmComment #10
xjmComment #11
No Sssweat CreditAttribution: No Sssweat commentedYou forgot to take off your developer hat, most people will have no idea what "H:i:s" means.
As you already mentioned, Internet Explorer 11, it doesn't display any place holder at all
So I suggest the message should be:
The Start date is invalid. Please enter a date in the format "hh:mm:ss", such as "09:45:30".
Comment #12
No Sssweat CreditAttribution: No Sssweat commentedA big issue I discovered on the original Microsoft Edge browser (Not the new Edge chromium, although, I have not tested that one, but likely will be fine).
When selecting a date, it doesn't allow the user to type it in, you must select from a popup and this provides only single-digit for the hour
Comment #14
Kumar Kundan CreditAttribution: Kumar Kundan commentedComment #15
Kumar Kundan CreditAttribution: Kumar Kundan commentedCurrently, placeholders are invalid for HTML5 date and DateTime. So placeholder will not be shown in time div & date div show default placeholder. This placeholder appears as an tooltips. Window appearance to select the date depends on browsers & this will be different on different browsers.
Comment #16
Kumar Kundan CreditAttribution: Kumar Kundan commentedComment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedI believe this is no longer an issue as it works in firefox and IE is no longer supported.
Comment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedI was not able to replicate and the issue hasn't been updated in 2 years. If it's still an issue feel free to reopen.
Comment #23
smustgrave CreditAttribution: smustgrave at Mobomo commented