dotnet / dotnet/runtime

DateOnly/TimeOnly support for XElement

Open
#126,879 2 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.