The Wayback Machine - https://web.archive.org/web/20240610065332/https://github.com/dotnet/aspnetcore/issues/33192
Skip to content
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

New DateOnly and TimeOnly Not handled in Blazor components in .Net 6 preview 4 #33192

Closed
frankabbruzzese opened this issue Jun 1, 2021 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Milestone

Comments

@frankabbruzzese
Copy link

Probably this is not a bug but just an implementation that has not been completed yet. Anyway, the issues are as follows:

  1. In Razor Views model properties of type DateOnly and TymeOnly do not render automatically as input type date and time respectively but as input type text. They do render properly only if properties are decorated with DataType attributes that specify respectively Date and Time types.
  2. In Razor Views and Pages, properties of type DateOnly and TymeOnly do not conform to the ViewContext.Html5DateRenderingMode setting but always render according to the current Culture.
  3. In Blazor components <input @bind-value = "MyTime"> and <input @bind-value = "MyDate"> complaint MyTyme and MyDate must be DateTime if they are respectively TimeOnly and DateOnly types.

Reproducing the error is trivial and can be done immediately in the Asp.net Core and Blazor default project templates.

  • ASP.NET Core version: 6 preview 4
  • Include the output of dotnet --info: Microsoft.NETCore.App 6.0.0-preview.4.21253.7
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: VS
@pranavkm pranavkm added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Jun 1, 2021
@javiercn
Copy link
Member

javiercn commented Jun 2, 2021

@frankabbruzzese thanks for filing this issue.

Yes, we need to add support for these new types across the board.

@javiercn javiercn added this to the Next sprint planning milestone Jun 2, 2021
@ghost
Copy link

ghost commented Jun 2, 2021

Thanks for contacting us.

We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@kinosang
Copy link

Also, DateOnly and TimeOnly are not handled properly in Asp.Net Controllers (such as data binding)

@pranavkm pranavkm changed the title New DateOnly and TimeOnly Not handled properly in Asp.net Views, Pages and Blazor components in .Net 6 preview 4 New DateOnly and TimeOnly Not handled in Blazor components in .Net 6 preview 4 Jul 21, 2021
@mkArtakMSFT
Copy link
Member

Closing this as a dupe of the above linked issue.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jul 27, 2021
@ghost ghost added the Status: Resolved label Jul 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

5 participants