ekrich / sjavatime

Implementation of java.time for Scala.js and Scala Native

Version Matrix

sjavatime

CI Scala.js

sjavatime is a BSD-licensed reimplementation of the java.time API included in JDK8 for Scala.js and Scala Native projects. This project was forked from scala-js-java-time which is deprecated.

Now the library supports both Scala.js and Scala Native.

Other choices

This project is ready today and cross compiled for all current Scala versions on Scala.js and Scala Native.

The following projects could be considered as alternatives, the second one for Scala.js only:

Usage

Maven Central

Simply add the following line to your sbt settings:

libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"

To use in sbt, replace x.y.z with the version from Maven Central badge above. All available versions can be seen at the Maven Repository.

If you have a crossProject, the setting must be used only in the JS and/or Native part:

lazy val myCross = crossProject
  ...
  .jsSettings(
    libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"
  )
  .nativeSettings(
    libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"
  )

Requirement: you must use a host JDK8 to build your project, i.e., to launch sbt. sjavatime does not work on earlier JDKs.

Linking errors

This library is not a complete implementation of java.time so if classes and methods are missing and you use them you will get linking errors.

Feel free to contribute to extend the set of supported classes and methods!

License

sjavatime is distributed under the BSD 3-Clause license.

Contributing

Follow the contributing guide.

Versions

Release 1.1.5 - (2021-05-13)
Release 1.1.4 - (2021-05-12)
Release 1.1.3 - (2021-04-01)
Release 1.1.2 - (2021-02-23)
Release 1.1.1 - (2021-02-01)
Release 1.1.0 - (2021-01-26)