Skip to content

DateOnly/TimeOnly support for XElement #126879

@danielmarbach

Description

@danielmarbach

As part of #56711 partial support for DateOnly and TimeOnly has been added by @StephenMolloy to XmlSerializer and DataContractSerializer.

XElement, though, has not been changed to support it. The constructor of XElement accepts a value object that then gets turned into a string value that is special-cased against various types, including DateTime, DateTimeOffset, Timespan but currently not DateOnly or TimeOnly

https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XContainer.cs#L807-L824

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.XmluntriagedNew issue has not been triaged by the area owner

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions