-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Support for additional date/time input types in <InputDate> and support for DateOnly/TimeOnly bindings. #34594
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
Conversation
Also fixed bug in ValidationComponent that caused FormTests to fail.
Something else to consider is whether we want to change the default parsing error message when the For, example, in the case of |
This is looking great! Superb job with all the tests too. |
@MackinnonBuck Validation has worked in my case until 12:00 for time. In Europe time is defined up to 23:59 23:00 is equivalent to 11PM. I would suggest to check if your implementation works with 24 hour time format. |
Hi @MarvinKlein1508. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
@MarvinKlein1508 Could you please clarify this a little? Date and time HTML elements (including What issues with validation were you experiencing and how did you produce them? Cheers. |
Hi @MackinnonBuck. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
sure. I created a small video for you which shows you what I mean. This is using the approach I mentioned in #34624 You can see it here: https://www.youtube.com/watch?v=y5DUWSMJVAA As you can see the input gets the invalid class when entering a value above 12:59 for time. I just want to let you know about this. Since your solution is a different approach I thought you might have the same issue. The component I used can be recreated with this code:
I have the same behaviour in all of my browsers. I am running Windows 10 in German with a German version of Firefox 90. |
Hi @MarvinKlein1508. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Thank you for the detailed response, @MarvinKlein1508! I have replicated your test and it appears to work fine with the implementation in this PR. 2021-07-27.10-29-36.mp4Thanks again for your help 😃 |
Hi @MackinnonBuck. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Support for additional date/time input types in
<InputDate>
and support forDateOnly
/TimeOnly
bindings.These changes add support for
month
,datetime-local
, andtime
input types for the<InputDate>
component. Binding support forDateOnly
andTimeOnly
has also been added.PR Description
Before these changes,
<input type="datetime-local" ...>
could not bind to aDateTime
without specifying a@bind-format
. This is no longer a requirement for use.Developers can also bind to the value of date/time inputs using the new
DateOnly
andTimeOnly
types. Currently, this works by first parsing as aDateTime
using the appropriate format, then converting to aDateOnly
orTimeOnly
. This allows someone to bind aDateOnly
when usingdatetime-local
, for instance, if they wish to ignore time information. If this is not a scenario we want to support, we could change this behavior.One can also now specify a
type
attribute for<InputDate>
if they wish to use a date/time input type other than "date". This keeps the API surface small, but we could alternatively introduce anInputDateType
enum parameter to<InputDate>
if that makes the feature more visible to developers.Validation
DateOnly
/TimeOnly
bindings for date/datetime-local/month/time inputs.<InputDate>
improvementsAddresses #12376