aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.48k stars 466 forks source link

Implement DateOnly and TimeOnly converters. #839

Closed stijnherreman closed 9 months ago

stijnherreman commented 10 months ago

Since .NET 6 there are two new types available for dates and times: DateOnly and TimeOnly. These new converters supplement the existing DateTimeConverter.

The unit tests are based on DateTimeConverterTests. Some tests were removed because they used DateTimeKind and were identical to other tests after removing all irrelevant code. Some test cases using date/time formats were removed because they made no sense in that context, or because the formats are explicitly unsupported (i.e. throwing an exception) for DateOnly or TimeOnly. The commented-out test cases fail, just like they do in DateTimeConverterTests. I'm not entirely sure why the various date/time format test cases exist, since they do not test additional code paths. But I've left them in for consistency.

EdwardCooke commented 9 months ago

Just waiting for the build to complete and I'll get a release out

aaubry commented 9 months ago

This feature has been released in version 13.7.0.