If you are using the iso8601
strategy, you may not want to rely on the default Equatable
implementation for Date
(==
) when comparing dates. You can use a good old fashion calendar comparison instead.
JSONEncoder and JSONDecoder can both be configured with a strategy (dateEncodingStrategy
and dateDecodingStrategy
) for encoding and decoding dates. There are four named types in addition to allowing you to provide custom options.
| Strategy | Comment |