Skip to content

Blazor : cannot bind nullable DateTime to input #9598

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

Closed
glacasa opened this issue Apr 20, 2019 · 2 comments
Closed

Blazor : cannot bind nullable DateTime to input #9598

glacasa opened this issue Apr 20, 2019 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@glacasa
Copy link

glacasa commented Apr 20, 2019

The issue #5541 is supposed to be solved on the last preview.

It works fine with int? and bool?, but I'm still not able to bind a nullable DateTime to an <input type="date">

The error is different than on the previous issue :
error CS0029: Cannot implicitly convert type 'string' to 'System.DateTime?'

Is it supposed to work, or is there a workaround for that ?

@blowdart blowdart added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 21, 2019
@danroth27 danroth27 added the area-blazor Includes: Blazor, Razor Components label Apr 22, 2019
@danroth27 danroth27 added this to the 3.0.0-preview7 milestone Apr 22, 2019
@danroth27 danroth27 added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Apr 22, 2019
@danroth27
Copy link
Member

Instead of handling this as a one off case we should look at handling this scenario in a more general way (maybe using TypeConverters or something similar?)

@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: 3.0.0-preview7, Backlog May 24, 2019
@mkArtakMSFT
Copy link
Member

This is already supported.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

4 participants