GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AnthonyCarl/NodaTime.Serialization.ServiceStackText: ServiceStack.Text support for NodaTime.

BranchesTags
Open more actions menu

Latest commit

 

History

63 Commits
63 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
LICENSE_NodaTime
LICENSE_NodaTime
 
 
LICENSE_ServiceStack
LICENSE_ServiceStack
 
 
NodaTimeLogo.png
NodaTimeLogo.png
 
 
README.md
README.md
 
 
build.bat
build.bat
 
 
build.cake
build.cake
 
 
build.ps1
build.ps1
 
 
cake.config
cake.config
 
 
version.json
version.json
 
 

Repository files navigation

NodaTime.Serialization.ServiceStackText

ServiceStack.Text JSON serialization support for NodaTime v2. This library will work with v5.0 and later versions of ServiceStack.Text.

Typical Setup

DateTimeZoneProviders.Tzdb
  .CreateDefaultSerializersForNodaTime()
  .ConfigureSerializersForNodaTime();

Optional Setup

There are static extension methods to allow for optional fluent configuration.

Use Iso Interval Serializer

DateTimeZoneProviders.Tzdb.CreateDefaultSerializersForNodaTime()
  .WithIsoIntervalSerializer()
  .ConfigureSerializersForNodaTime();

Use Iso Period Serializer

DateTimeZoneProviders.Tzdb.CreateDefaultSerializersForNodaTime()
  .WithNormalizingIsoPeriodSerializer()
  .ConfigureSerializersForNodaTime();

One-Off Serializer Setup

//You could create you own serializer by implementing IServiceStackSerializer<T>
NodaSerializerDefinitions.LocalTimeSerializer.ConfigureSerializer();

Alternatively, you can create your own implementation of INodaSerializerSettings to suit your specific needs.

Default Serializers

The SerivceStack.Text serializer uses the same default serialization formats as those used in the Json.NET serializers. You can optionally change the Interval serializer to use the ISO 8601 Interval spec.

Notes

  • Serializer setup should only occur once in your application root.
  • Serialization setup should occur before any serialization occurs with ServiceStack.Text or there may be undesirable behavior.
  • If using with ServiceStack, serializer setup should occur before Init of the AppHost.
  • For Value types, this will also setup the nullable serializer for that value type.
  • Since this is a custom serializer for ServiceStack.Text, calls to JsConfig.Reset() will remove the custom serializers.

Using the Code

  • Install the NuGet Package
  • NuGet Packages from Latest Successful Build
  • You can check out the code and run build.bat. It will create NuGet packages you can consume in .\ReleasePackages or you can directly use the resulting binaries.

Continuous Integration

JetBrains TeamCity CI Build Status: Build Status

Special Thanks to JetBrains for hosting this project!

About

ServiceStack.Text support for NodaTime.

Resources

Readme
Activity

Stars

18 stars

Watchers

5 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.