Skip to content

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

@frankabbruzzese

Description

@frankabbruzzese

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issueStatus: Resolvedarea-blazorIncludes: Blazor, Razor Componentsarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions