XmlSchemaClassGenerator icon indicating copy to clipboard operation
XmlSchemaClassGenerator copied to clipboard

Option to use DateOnly rather than DateTime when using xsd date type

Open oleholstandersen opened this issue 1 year ago • 6 comments

Similar to https://github.com/mganss/XmlSchemaClassGenerator/issues/310

oleholstandersen avatar Jul 11 '24 06:07 oleholstandersen

+1 for this

Lanayx avatar Jul 29 '25 18:07 Lanayx

As XmlSerializer doesn't seem to support DateOnly yet, is there a use case for it?

mganss avatar Jul 30 '25 17:07 mganss

Ah, you are right, just found the issue https://github.com/dotnet/runtime/issues/56711

Lanayx avatar Jul 30 '25 20:07 Lanayx

Maybe generating NodaTime types is an option? They seem to support xml serialization properly https://nodatime.org/1.2.x/userguide/serialization

Lanayx avatar Jul 30 '25 20:07 Lanayx

@Lanayx That's a good idea. I probably won't get to it soon but PRs are always welcome.

mganss avatar Jul 31 '25 10:07 mganss

@mganss it did happen! DateOnly support has been merged to .NET 10 https://github.com/dotnet/runtime/pull/120013

Lanayx avatar Sep 29 '25 03:09 Lanayx