Skip to content

A port of NodaTime.Serialization.JsonNet to utilize Utf8Json instead

License

Notifications You must be signed in to change notification settings

DSilence/NodaTime.Serialization.Utf8Json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9996713 · Feb 16, 2021

History

26 Commits
Feb 16, 2021
Feb 16, 2021
Dec 27, 2018
Jan 1, 2019
Jan 1, 2019
Dec 27, 2018
Feb 8, 2019
Feb 16, 2021
Jan 1, 2019
Jan 1, 2019

Repository files navigation

Build Status Test results Coverage results Nuget Package

NodaTime.Serialization.Utf8Json

A port of NodaTime.Serialization.JsonNet to utilize Utf8Json instead

Sample Usage

using DS.NodaTime.Serialization.Utf8Json;
using NodaTime;
using Utf8Json;
using Utf8Json.Resolvers;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
           CompositeResolver.RegisterAndSetAsDefault(
                new NodaTimeResolver(DateTimeZoneProviders.Tzdb, NameHandling.CamelCase, true, true, true),
                StandardResolver.ExcludeNullCamelCase);
            var json = JsonSerializer.ToJsonString(new LocalDate(2019, 1, 1);
        }
    }
}