Skip to content

Conversation

@glts
Copy link

@glts glts commented May 11, 2018

The change proposed here extends the Inst protocol to org.joda.time.ReadableInstant when clj-time.core is loaded. Since Inst was only added in Clojure 1.9, the extension is conditional on availability of Inst.

This should resolve #248.

Notes about the changes:

  • Of all the Joda-Time API classes the interface org.joda.time.ReadableInstant (which is implemented by org.joda.time.DateTime) seems best suited for extension to Inst.
  • I renamed the Leiningen profile :spec to :1.9 to better reflect what’s in the tests (not just spec).

This changeset seems reasonable to me but of course I am happy to incorporate any feedback you might have.

@seancorfield
Copy link
Member

The change to project.clj is incorrect. The default Clojure tested against is already 1.9. The :spec profile brings in the spec tests and test.check. Please revert that and update the PR.

@michaelklishin
Copy link
Member

@seancorfield beat me to it :) Otherwise the idea is sound 👍.

@glts
Copy link
Author

glts commented May 11, 2018

Excellent, thank you, have updated the pull request.

@seancorfield seancorfield merged commit 34071ab into clj-time:master May 11, 2018
@seancorfield
Copy link
Member

It's a minor nit-pick but the test(s) will "only" get exercised in the :spec profile, not for plain Clojure 1.9 testing (the default), but that is part of test-all so that's fine.

@glts
Copy link
Author

glts commented May 11, 2018

@seancorfield Yes, and that is why I had renamed the profile to :1.9 first.

Thank you both for the prompt review and merge!

@seancorfield
Copy link
Member

@michaelklishin I updated the changelog -- do you think this warrants a 0.14.4 release?

@michaelklishin
Copy link
Member

@seancorfield it's a pretty useful thing, so why not ship it sooner.

@seancorfield
Copy link
Member

0.14.4 just went up to Clojars!

@glts
Copy link
Author

glts commented May 16, 2018

Perfect, thank you!

Sign up for free to 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.

Extend Inst protocol to org.joda.time.DateTime

3 participants