scalajs-jsjoda


License

License

Categories

Categories

JavaScript Languages Scala
GroupId

GroupId

com.zoepepper
ArtifactId

ArtifactId

scalajs-jsjoda_sjs0.6_2.11
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

scalajs-jsjoda
scalajs-jsjoda
Project URL

Project URL

https://github.com/zoepepper/scalajs-jsjoda
Project Organization

Project Organization

com.zoepepper
Source Code Management

Source Code Management

https://github.com/zoepepper/scalajs-jsjoda

Download scalajs-jsjoda_sjs0.6_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.zoepepper/scalajs-jsjoda_sjs0.6_2.11/ -->
<dependency>
    <groupId>com.zoepepper</groupId>
    <artifactId>scalajs-jsjoda_sjs0.6_2.11</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.zoepepper/scalajs-jsjoda_sjs0.6_2.11/
implementation 'com.zoepepper:scalajs-jsjoda_sjs0.6_2.11:1.2.0'
// https://jarcasting.com/artifacts/com.zoepepper/scalajs-jsjoda_sjs0.6_2.11/
implementation ("com.zoepepper:scalajs-jsjoda_sjs0.6_2.11:1.2.0")
'com.zoepepper:scalajs-jsjoda_sjs0.6_2.11:jar:1.2.0'
<dependency org="com.zoepepper" name="scalajs-jsjoda_sjs0.6_2.11" rev="1.2.0">
  <artifact name="scalajs-jsjoda_sjs0.6_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.zoepepper', module='scalajs-jsjoda_sjs0.6_2.11', version='1.2.0')
)
libraryDependencies += "com.zoepepper" % "scalajs-jsjoda_sjs0.6_2.11" % "1.2.0"
[com.zoepepper/scalajs-jsjoda_sjs0.6_2.11 "1.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
org.scala-js : scalajs-library_2.11 jar 0.6.33
org.scala-lang.modules : scala-collection-compat_2.11 jar 2.1.6

test (3)

Group / Artifact Type Version
org.webjars.npm : js-joda jar 1.6.2
org.scala-js : scalajs-test-bridge_2.11 jar 0.6.33
com.lihaoyi : utest_sjs0.6_2.11 jar 0.6.8

Project Modules

There are no modules declared in this project.

scalajs-jsjoda

scalajs-jsjoda consists of 2 subprojects:

  • facade: A Scala.js facade for the js-joda JavaScript library (https://github.com/js-joda/js-joda).
  • java-time-drop-in: A proxy to the facade that sits in the java.time package, implementing as much as possible of Java 8's java.time API by delegating to the js-joda facade. This effectively enables most of the java.time API in Scala.js projects.

Usage

To just use the js-joda facade, simply add the following line to your sbt settings:

libraryDependencies += "com.zoepepper" %%% "scalajs-jsjoda" % "1.1.1"

To use the facade as a java.time API implementation, add also:

libraryDependencies += "com.zoepepper" %%% "scalajs-jsjoda-as-java-time" % "1.1.1"

If you have a crossProject, the settings must be used only in the JS part:

lazy val myCross = crossProject.
  ...
  jsSettings.(
    libraryDependencies ++= Seq(
      "com.zoepepper" %%% "scalajs-jsjoda" % "1.1.1",
      "com.zoepepper" %%% "scalajs-jsjoda-as-java-time" % "1.1.1"
    )
  )

Requirements

Version 1.1.8 or greater of js-joda needs to be available in your JS runtime. This can be achieved by adding to sbt:

jsDependencies += "org.webjars.npm" % "js-joda" % "1.1.8" / "dist/js-joda.js" minified "dist/js-joda.min.js"

We recommend using the latest version of js-joda and js-joda-time nonetheless.

Timezone support

If you need timezone support, at least version 1.3.0 of js-joda is required, as well as its 'js-joda-timezone' addon:

jsDependencies ++= Seq(
  "org.webjars.npm" % "js-joda" % "1.3.0" / "dist/js-joda.js" minified "dist/js-joda.min.js",
  "org.webjars.npm" % "js-joda-timezone" % "1.0.0" / "dist/js-joda-timezone.js" minified "dist/js-joda-timezone.min.js"
)

If you use the java-time-drop-in, then the js-joda-timezone will be automatically bootstrapped for you. However, if you want to just use the facade without the java-time-drop-in, you need to bootstrap manually by calling:

import com.zoepepper.facades.jsjoda._

JSJoda.use(JSJodaTimezone)

Caveats

Limited functionality

Usage is limited to functionality provided by js-joda. At the moment, this means:

  • Limited to IsoChronology (no support for Hijrah, Japanese, Minguo or ThaiBuddhist chronologies).
  • No OffsetTime/OffsetDateTime support.
  • No Locale support.

Conflicts with other java.time._ drop-ins

When using java-time-drop-in make sure you don't have conflicting implementations in your dependencies (including transitive ones). Otherwise you can experience linking errors.

For example, presence of scala-js-java-time can lead to linking errors like the following:

[error] Referring to non-existent method java.time.temporal.Temporal.until(java.time.temporal.Temporal,java.time.temporal.TemporalUnit)scala.Long
[error]   called from java.time.ZonedDateTime.until(java.time.temporal.Temporal,java.time.temporal.TemporalUnit)scala.Long
com.zoepepper

ZOE PEPPER

Versions

Version
1.2.0
1.1.1
1.1.0
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0