-
Notifications
You must be signed in to change notification settings - Fork 11
feat: use RFC3339 to format dates, fixes ipfs/go-ipld-git#16 #43
Conversation
b684336
to
44fbc76
Compare
Codecov Report
@@ Coverage Diff @@
## master #43 +/- ##
==========================================
+ Coverage 92.03% 92.23% +0.19%
==========================================
Files 7 7
Lines 314 322 +8
==========================================
+ Hits 289 297 +8
Misses 25 25
Continue to review full report at Codecov.
|
Is there an alternative to the Do I understand the issue with tests could be fixed with updating the fixtures? |
I will look for an alternative method.
Looked into this -- turns out I confused the purpose of serialize & deserialize; I thought serialize produced the dagNode, when that's what deserialize does so the logic is reversed. I have pushed and fixed this, so the fixtures don't need to be updated. |
Ok, took me a few hours but I wrote functions for converting between raw timestamps and ISO8601 ones. I'm not convinced that it's completely correct so probably will need some more tests to verify it. |
https://github.com/samsonjs/strftime is usually the go-to when you only need to format time strings, it might be safer than rolling our own date formatter |
Good point, I'll update the PR with that in a minute. |
Ok, that made things a lot simpler. Thanks @rvagg! |
From the size increase perspective (about 16KB) it looks fine to me. It would be great if you @magik6k could check if it is correct (I don't really have a clue what's going on :) |
Thanks a lot @sameer for this change! I added a "BREAKING CHANGE" to the commit message, so that it shows up in the changelog. |
Related to ipfs/go-ipld-git#32. Use RFC3339 to format dates in JSON output.