Releases: vpavkin/dtc
2.6.0
Support Scala.js 1.0.0.
v2.4.0 Releasing 2.4.0
2.3.1
2.0.0-M1
2.0.0-M1
This major release aims to fix a specific design flaw, which is impossibility to construct Local
values from
zone-aware instants. Prior to 2.0, such option was an exclusive privilege of Zoned
.
In practice this introduced limitations in correctly abstracting over UTC/Zoned time representations.
Inability to grasp this aspect from the beginning leaded to creation of arcane localDateTimeAsZoned
instance.
This trick allowed to use LocalDateTime
in Zoned
context, which provided an ability to construct values polymorphically.
Such abuse created it's own issues, in particular - ability to create LocalDateTime
values in some Zoned
contexts,
where it didn't make any sense.
Version 2.0 resolves this issue by extracting time creation functionality in a separate Capture
typeclass.
Now it's possible to specify an exact polymorphic context you need:
TimePoint
for a generic instantTimePoint
+Capture
for a generic instant that can be constructed in a instant-preserving way.Zoned
for a zone-aware value for full control over zoning (no locals here from now on)Local
specifically for local (or UTC) instant, without zone information and control over it.
Migration from 1.* to 2.0.0-M1:
-
Now there's no
Zoned
instance forLocalDateTime
.For each place you use it there're two options:
- It's zoned-only code, that doesn't make any sense in local context.
In such case you have a better protection now from accidentally using it in an incorrect context. - It's an abstraction over UTC/Zoned contexts.
In such case you should be able to replace the context bound fromZoned
toTimePoint
+Capture
.
- It's zoned-only code, that doesn't make any sense in local context.
-
Zoned.of[T](...)
was removed. UseCapture[T](...)
-
Lawless
was renamed toTimePoint
.
Other potentially breaking changes:
- Explicit implementation of
hashCode
was added to moment wrapper classes,
which can lead to different behaviour inMap
s. - [Laws]
Zoned.constructorConsistency
law is gone. Proper laws forCapture
are work in progress.