Comments (5)
do I understand correctly that you have data with org.joda.time.Instant
/org.joda.time.DateTime
fields inside which you want to serialize into ISO8601 strings?
Haven't actually noticed Inst
before. Your solution would definitely work. It has an additional benefit of not transforming the datastructure just to change the type of instants. Also, there shouldn't be any problems with globally extending Inst
for DateTime
as in Joda-Time it is analogous to an Instant.
I don't think there's anything in this project that can help you do what you want to do in a more direct way.
from clojure.java-time.
Yeah, my problem is fully solved by this piece of code, but perhaps it'd be good to add this to the portability code here so it automatically works for everyone :)
It might make more sense in clj-time instead?
from clojure.java-time.
Hmm, I think adding
(extend-type org.joda.time.ReadableInstant
Inst (inst-ms* [inst] (.getMillis inst)))
shouldn't break anything. However, a library shouldn't be extending foreign types with foreign protocols. This may have a place in an explicitly invoked method or documentation though.
from clojure.java-time.
Added a when-joda-time-loaded
macro to the public API. Updated docs.
from clojure.java-time.
Cool, thanks :) I look forward to using this feature in a new release.
from clojure.java-time.
Related Issues (20)
- `zoned-date-time` with a single argument does not use `java-time.clock/make` HOT 1
- Canadian locale doesn't support AM/PM? HOT 1
- Instant < Interval breaks transitivity
- `not-{before,after}?` broken for equal arguments that need coercion
- Add a way to access DateTimeFormatter.ofLocalizedDate() etc.
- on-or-after? on-or-before? HOT 1
- Millisecond information for `java.sql.Time` is lost when converting to/from `LocalTime` HOT 1
- Unix timestamp conversion HOT 1
- Various properties gone missing in 0.3.3 HOT 7
- 0.3.3 - Year formatted wrongly on date roll ? HOT 3
- Consider Removing clj-tuple HOT 2
- Minor Clojure 1.11 Alpha 4 compatibility issue HOT 1
- Cut new release for Clojure 1.11 compat? HOT 23
- PriorityQueue class not found in babashka HOT 1
- Babashka Support HOT 1
- Type conversion graph is dependent on evaluation order HOT 1
- Deprecate single segment ns HOT 4
- Things like `java-time[.api]/truncate-to` do not work correctly when underlying protocol is extended HOT 5
- Case bug in https://github.com/dm3/clojure.java-time/blob/master/src/java_time/format.clj#L32 HOT 1
- `not-after?` not semantically equivalent to `<=` despite documentation implying otherwise HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clojure.java-time.