You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A flexible and powerful library for customizing `DateTime`and `DateTimeOffset` serialization in System.Text.Json, with full support for both reflection-based and source generator approaches.
7
+
A flexible and powerful library for customizing `DateTime`, `DateTimeOffset`, `DateOnly`, and `TimeOnly` serialization in System.Text.Json, with full support for both reflection-based and source generator approaches.
8
8
9
9
## Table of Contents
10
10
@@ -24,7 +24,7 @@ A flexible and powerful library for customizing `DateTime` and `DateTimeOffset`
24
24
25
25
## Overview
26
26
27
-
This package provides four ways to specify custom date formats for `DateTime`, `DateTimeOffset`, and their nullable counterparts when serializing and deserializing JSON using `System.Text.Json`:
27
+
This package provides four ways to specify custom date formats for `DateTime`, `DateTimeOffset`, `DateOnly`, `TimeOnly`, and their nullable counterparts when serializing and deserializing JSON using `System.Text.Json`:
28
28
29
29
1.**`JsonDateTimeConverterAttribute`** - Simple attribute-based approach (reflection only, or .NET 9+ with resolver but produces warnings)
30
30
2.**`JsonDateTimeFormatAttribute`** - Clean attribute for source generators with .NET 9+ resolver (no warnings)
@@ -427,6 +459,10 @@ This matches standard `System.Text.Json` behavior.
427
459
-`DateTime?`
428
460
-`DateTimeOffset`
429
461
-`DateTimeOffset?`
462
+
-`DateOnly`
463
+
-`DateOnly?`
464
+
-`TimeOnly`
465
+
-`TimeOnly?`
430
466
431
467
All types support any valid [.NET date and time format string](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings).
0 commit comments