Giter Site home page Giter Site logo

scalajs-jsjoda's People

Contributors

ant8e avatar exoego avatar rpiaggio avatar vpavkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalajs-jsjoda's Issues

Equals does not seem to work correctly on several classes

At least for java.time.LocalDate and java.time.Month, the equals function does not seem to work properly.
Looking at the code of LocalDate, equals is implemented by calling com.zoepepper.facades.jsjoda.LocalDate.equals. That, in turn, is not implemented at all, thus probably falling back to reference identity. The function isEqual, however, is implemented. Perhaps that one should be used instead?

Version 1.2.0 of scalajs-jsjoda-as-java-time not working with Scala.js 0.6.33

It seems version 1.2.0 of scalajs-jsjoda-as-java-time is published for both 1.0 and 0.6 (see https://mvnrepository.com/artifact/com.zoepepper/scalajs-jsjoda-as-java-time), but when I try to use it with a 0.6.33 version, I get following error:

[error] org.scalajs.core.ir.IRVersionNotSupportedException: Failed to deserialize info of file compiled with Scala.js 1.1 (supported: 0.6.0, 0.6.13, 0.6.3, 0.6.17, 0.6.4, 0.6.6, 0.6.14, 0.6.8, 0.6.29, 0.6.5, 0.6.15): /home/runner/.cache/coursier/v1/https/repo1.maven.org/maven2/com/zoepepper/scalajs-jsjoda-as-java-time_sjs0.6_2.12/1.2.0/scalajs-jsjoda-as-java-time_sjs0.6_2.12-1.2.0.jar:java/time/chrono/package.sjsir

See https://github.com/OpenGrabeso/cohubo/runs/1026884673, which is a build of https://github.com/OpenGrabeso/cohubo

It seems I can use scalajs-jsjoda version 1.2.0 just fine, but not scalajs-jsjoda-as-java-time.

Missing license

I would like to know what OSS license this repository is using.
Because I would like to contribute new feature/bugfix, or fork if this repository is no longer maintained.
Thanks for years of working.

Update for new scoped package versions

Currently the facade is supported by [email protected]. Recently this usage has been deprecated.
All js-joda libraries are moved and put all js-joda npm modules under the @js-joda scope. (https://github.com/js-joda/js-joda)

This does not work under sbt.

jsDependencies += "org.webjars.npm" % "js-joda__core" % "3.2.0" / "js-joda__core" minified "js-joda__core.min.js"
jsDependencies += "org.webjars.npm" % "js-joda__timezone" % "2.5.0" / "js-joda__timezone" minified "js-joda__timezone.min.js"

Can't install based on current README instructions

The README currently has the installation instructions as:

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

However there is no 1.1.1 version at https://repo1.maven.org/maven2/com/zoepepper/scalajs-jsjoda_sjs1_2.12/

Changing to 1.2.0 allows installation to succeed. However I don't see a 1.2.0 release in the repo so I'm questioning the validity of that install

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

Link error

Hello!

Your project looks as a really promising tool for cross-platform time-based business logic. But I came across following issue.

Here's a simple scalajs program:

// notice original facade imports

import com.zoepepper.facades.jsjoda.ZonedDateTime
import com.zoepepper.facades.jsjoda.temporal.ChronoUnit

import scala.scalajs.js.annotation.{JSExport, JSExportTopLevel}

object Main {
  @JSExportTopLevel("joda.Main")
  protected def getInstance(): this.type = this

  @JSExport
  def main(): Unit = {
    val t1 = ZonedDateTime.now()
    val t2 = ZonedDateTime.now().plusDays(1L)
    println(t1.until(t2, ChronoUnit.MINUTES))
  }
}

It works fine. But when I change imports to java.time._ to use the drop-in, I get link error:

// notice changed imports
import java.time.ZonedDateTime
import java.time.temporal.ChronoUnit

// ... previous code unchanged
 Referring to non-existent method java.time.temporal.Temporal.until(java.time.temporal.Temporal,java.time.temporal.TemporalUnit)scala.Long

This makes it very hard to use in cross-platform context. Do you have any ideas for how this can be fixed/worked around?

Non-existent method Instant.from(temporal: TemporalAccessor)

Instant.from gives me a compile error: Referring to non-existent method java.time.Instant$.from(java.time.temporal.TemporalAccessor)java.time.Instant

Looks like the scalajs-jsjoda facade method is different from the original java method, hence the compile error.
jsjoda: java.time.Instant.from(temporal: Temporal)
orinal java: java.time.Instant.from(temporal: TemporalAccessor)

Is this done deliberately? If yes, why?

I can work-around this issue by using LocalDateTIme.from(...).toInstant(ZoneOffset.UTC) or by ZonedDateTime.

LocalTime.MIDNIGHT causes linker error

I'm getting a linker error when I use LocalTime.MIDNIGHT in ScalaJs:

[cosmere] $ test:fastOptJS
[info] Compiling 1 Scala source to D:\extradash\src\pathfinder2\nexus\js\target\scala-2.11\classes...
[info] Fast optimizing D:\extradash\src\pathfinder2\midgar\modules\cosmere\chart-client\target\scala-2.11\cosmere-chart-client-test-fastopt.js
[error] Referring to non-existent method java.time.LocalTime$.MIDNIGHT()java.time.LocalTime
[error] called from com.extrategic.pathfinder.TradingSession$.()

Do you know why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.