@@ -16,9 +16,7 @@ The implementation is based on the original BSD-licensed reference implementatio
16
16
#### Example
17
17
18
18
``` tut:book
19
- // On scala.js you can pick either java.time or org.threeten.bp package to import
20
- //import java.time._
21
- import org.threeten.bp._
19
+ import java.time._
22
20
23
21
// always returns 2009-02-13T23:31:30
24
22
val fixedClock = Clock.fixed(Instant.ofEpochSecond(1234567890L), ZoneOffset.ofHours(0))
@@ -60,8 +58,8 @@ Both Scala 2.11 and Scala 2.12 (2.0.0-M8 and later) are supported.
60
58
61
59
To get started with SBT, add one of these dependencies:
62
60
63
- * ` libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M12 " ` (for Scala)
64
- * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M12 " ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
61
+ * ` libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M13 " ` (for Scala)
62
+ * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M13 " ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
65
63
66
64
To get the latest snapshots add the repo
67
65
@@ -72,8 +70,8 @@ resolvers +=
72
70
73
71
and either:
74
72
75
- * ` libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M13 -SNAPSHOT" ` (for Scala)
76
- * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M13 -SNAPSHOT" ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
73
+ * ` libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M14 -SNAPSHOT" ` (for Scala)
74
+ * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M14 -SNAPSHOT" ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
77
75
78
76
### Time zones
79
77
@@ -86,7 +84,7 @@ If you don't need to use timezones in your application you can just stop here. B
86
84
The timezone for js is provided in a separate bundle which contains all time zones available from
87
85
[ IANA Time Zone Database] ( https://www.iana.org/time-zones ) . To use them you need to add the following dependency
88
86
89
- * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.0.0-M13_2018c-SNAPSHOT " ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
87
+ * ` libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.0.0-M13_2018c" ` (for Scala.js, [ Scala.js plugin] ( http://www.scala-js.org/tutorial/basic/#sbt-setup ) required)
90
88
91
89
Note that the db is fairly large and due to the characteristics of the API it's not very ammenable to optimization
92
90
This database is published every now and then so it maybe old. For current version see the following section.
@@ -103,7 +101,7 @@ To do that you need to:
103
101
* Add ` sbt-tzdb ` to your list of plugins (Note you need sbt 1.x)
104
102
105
103
``` scala
106
- addSbtPlugin(" io.github.cquiroz" % " sbt-tzdb" % " 0.1.1 " )
104
+ addSbtPlugin(" io.github.cquiroz" % " sbt-tzdb" % " 0.1.2 " )
107
105
```
108
106
109
107
* Enable the plugin for your ` Scala.js ` project:
@@ -156,12 +154,19 @@ Have a look at the [issues](https://github.com/cquiroz/scala-java-time/issues) o
156
154
157
155
##### 2.0
158
156
159
- The current version is published containing the code in both packages: ` org.threeten.bp ` and ` java.time ` .
160
-
161
157
A stable release of 2.0 will be published with only ` java.time ` on its binary after a (hopefully) short RC phase.
162
158
163
159
#### FAQs
164
160
161
+ ##### What's with the packages? the code uses ` org.threeten.bp ` but I use ` java.time `
162
+
163
+ The original code was in the ` org.threeten.bp ` and that has been maintained, among other reasons, because writing
164
+ code on the ` java ` namespace tends to produce issues with the security controls of the JVM
165
+
166
+ Thus the code is on ` org.threeten.bp ` but during packaging the code is moved to ` java.time ` and ` org.threeten.bp ` is removed.
167
+
168
+ Most applications would use the ` java.time ` package mirroring the JVM
169
+
165
170
##### Is this project derived from OpenJDK?
166
171
167
172
No. This project is derived from the Reference Implementation previously hosted on GitHub.
0 commit comments