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

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);
        }
    }
}

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published