FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add built-in support for .NET 6 `DateOnly` and `TimeOnly` types by AArnott · Pull Request #1427 · MessagePack-CSharp/MessagePack-CSharp · GitHub

Add built-in support for .NET 6 DateOnly and TimeOnly types - #1427

Merged
AArnott merged 3 commits into
MessagePack-CSharp:developfrom
AArnott:fix1240_dateonly
May 24, 2022
Merged

AArnott merged 3 commits into
MessagePack-CSharp:developfrom
AArnott:fix1240_dateonly

Conversation

AArnott commented Apr 26, 2022

Copy link
Copy Markdown
Collaborator

DateOnly requires 5 bytes (typically).
TimeOnly requires 6 bytes for second resolution or 8 bytes for ticks resolution. This is automatically selected based on the original value.

Because TimeOnly uses an extension, I claim another extension type code. I venture to add documentation to the README to actually reserve a range of type codes for this and future use, where this previously wasn't done, which makes every additional type code we use risky because it may collide with a user of this library's custom extensions.

Closes #1240

AArnott added this to the v2.4 milestone Apr 26, 2022
AArnott requested a review from neuecc April 26, 2022 15:34

neuecc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If DateOnly uses DayNumber as int, why not TimeOnly just use Ticks as long?
Seems like a bad idea to use an extension for this.

AArnott commented May 24, 2022

Copy link
Copy Markdown
Collaborator Author

Is it really that appropriate to use a msgpack primitive type to represent a value that isn't meant to be interpreted as a primitive? I'm on the fence at the moment on that point.
But sure, I don't have a strong objection so I'll redo with long ticks for TimeOnly.

AArnott force-pushed the fix1240_dateonly branch from 13637a1 to 1974603 Compare May 24, 2022 02:48

neuecc commented May 24, 2022

Copy link
Copy Markdown
Member

Ok, thanks!

AArnott force-pushed the fix1240_dateonly branch from 1974603 to 513c198 Compare May 24, 2022 13:31
AArnott and others added 3 commits May 24, 2022 10:08
`DateOnly` requires 5 bytes (typically).
`TimeOnly` requires 6 bytes for second resolution or 8 bytes for ticks resolution. This is automatically selected based on the original value.

Closes MessagePack-CSharp#1240

# Conflicts:
#	src/MessagePack/net6.0/PublicAPI.Unshipped.txt
AArnott force-pushed the fix1240_dateonly branch from 513c198 to 14ed43c Compare May 24, 2022 16:10
AArnott merged commit 623aaf2 into MessagePack-CSharp:develop May 24, 2022
AArnott deleted the fix1240_dateonly branch May 24, 2022 17:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL