Skip to content

CodableDate: A clean way to handle different date formatters.

License

Notifications You must be signed in to change notification settings

crazymanish/CodableDate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CodableDate

A clean way to handle different date formatters.

The problem: a codable JSON with different date formats... 🤔

The problem arises when we get a JSON with different date formats, like this one.

The solution 🚀

Step1: Let’s define a protocol

Step2: Let’s define generic date wrapper

Step3: Let's define different style date formatters, based on input JSON

Show time! 🔨

Let's test it, in playground

Output is: 🙌🏻💪🏻


Tools Version

  • Xcode 11.1
  • macOS 10.15.1

Swift version

  • Swift 5.1

LICENSE

  • MIT

About

CodableDate: A clean way to handle different date formatters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages