DateOnly/TimeOnly support for XElement
Open
area-System.Xml
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
As part of https://github.com/dotnet/runtime/issues/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
Contributor guide
Assessment
This issue has not been assessed yet.