Skip to content

Date Encoding/Decoding Strategy - #14

Merged
swhitty merged 3 commits into
mainfrom
DateEncodingStrategy
Jul 20, 2025
Merged

Date Encoding/Decoding Strategy#14
swhitty merged 3 commits into
mainfrom
DateEncodingStrategy

Conversation

@swhitty

Copy link
Copy Markdown
Owner

Adds DateEncoding/DecodingStrategy allowing for dates to be encoded using alternate formats by setting the strategy.

The (existing) default strategy casts to Any leaving the instance unchanged:

varencoder=KeyValueEncoder()
encoder.dateEncodingStrategy =.date
// Date()
letany=try encoder.encode(Date())

ISO8601 compatible strings can be used:

encoder.dateEncodingStrategy =.iso8601()
// "1970-01-01T00:00:00Z"
letany=try encoder.encode(Date(timeIntervalSince1970:0))

@codecov-commenter

codecov-commenter commented Jul 20, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (f2058a2) to head (c584af0).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #14 +/- ##
=======================================
Coverage 99.89% 99.89% =======================================
Files 3 3 Lines 951 983 +32 =======================================
+ Hits 950 982 +32 
Misses 1 1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swhitty
swhittyforce-pushed the DateEncodingStrategy branch from e746b58 to af37715CompareJuly 20, 2025 03:58
@swhitty
swhittyforce-pushed the DateEncodingStrategy branch from af37715 to c584af0CompareJuly 20, 2025 04:00
@swhitty
swhitty merged commit 3d6ca2b into mainJul 20, 2025
@swhitty
swhitty deleted the DateEncodingStrategy branch July 20, 2025 04:03
@swhittyswhitty mentioned this pull request Aug 14, 2025
@swhittyswhitty mentioned this pull request Jan 7, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@swhitty@codecov-commenter