GeezerVison is showing github.com — For net6, support DateOnly and TimeOnly · Issue #1240 · MessagePack-CSharp/MessagePack-CSharp
For net6, support DateOnly and TimeOnly #1240DescriptionAdd built-in support on .NET 6 for the new DateOnly and TimeOnly types as described here: dotnet/runtime#50980 Reacted by saxmaster79, Aleksandr and Wasenshi Reacted by Energy Activitysimonziegler commented on Jun 18, 2021 Hi @AArnott - I'm keen to use DateOnly in my project as soon as possible. I need to cut over from DateTime to DateOnly before I commit to a database scheme ahead of imminent release. MessagePack is central to my project and I wonder if you can suggest a work around to allow me to use DateOnly before MessagePack is ready. Here is the exception I get indicating the relevant resolver:
MessagePack.MessagePackSerializationException: Failed to serialize MyProject.MyClass value.
---> MessagePack.FormatterNotRegisteredException: System.DateOnly is not registered in resolver: MessagePack.Resolvers.CompositeResolver+CachingResolver
Please ignore this - I inspected what MessagePack does for DateTime and built my own formatter and resolver. Instead of DateTime.ToBinary() I used DateOnly.Daynumber, which is an int. Reacted by Andrew Arnott and w3lld0ne github-actions commented on Sep 17, 2021 This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. kzu commented on Dec 13, 2021 I think this issue should be reopened and actually fixed :) ordinaryorange commented on Jan 24, 2022 I see DateTime uses the .ToBinary() method during serialization.
Under the hood .ToBinary() attempts some conversions to account for localtime, but DateOnly has no concept of localtime/UTC etc
DateOnly does not have a .ToBinary() equiv so the easiest way out of this to simply use the DayNumber property and just serialize the int. github-actions commented on Apr 26, 2022 This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. added a commit that references this issue on Apr 26, 2022This issue will close once commit 13637a1 is merged into the 'master' branch.13637a1 AArnott commented on Apr 26, 2022 CollaboratorAuthor More actions I invite anyone interested in this feature to review my PR and comment on the format I'm using for these types. added 3 commits that reference this issue on May 24, 2022This issue will close once commit 1974603 is merged into the 'master' branch.1974603 This issue will close once commit d255f30 is merged into the 'master' branch.d255f30 This issue will close once commit c7ef724 is merged into the 'master' branch.c7ef724 PatrickDRusk commented on Jun 6, 2022 Is there a schedule by when this will appear in a Nuget package? AArnott commented on Jun 7, 2022 CollaboratorAuthor More actions No. It's kind of on an on-demand basis. So your vote of interest is enough to move the wheel a bit. I'll try to review other active issues to see if we have anything else we can roll into another prerelease of 2.4. PatrickDRusk commented on Jun 9, 2022 It would be much appreciated. Thanks. AArnott commented on Jun 9, 2022 CollaboratorAuthor More actions
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|