diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-02 04:57:37 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-02 04:57:37 -0800 |
commit | a33254276bd211bf33be86eeb871ddbfe36fdb47 (patch) | |
tree | b257d473be4fa110f7846f372ea94fc6714dad90 /examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala | |
parent | d00a2e25a9ee527fa39feb04c3137715501e9fda (diff) | |
download | hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.tar.gz hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.tar.bz2 hands-on-scala-js-a33254276bd211bf33be86eeb871ddbfe36fdb47.zip |
Moved `examples` into `examples/demos`, sketched out a simple example cross-module
Diffstat (limited to 'examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala')
-rw-r--r-- | examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala new file mode 100644 index 0000000..40f65f4 --- /dev/null +++ b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala @@ -0,0 +1,18 @@ +/*js/src/main/scala/simple/Platform.scala*/ +package simple +import scala.scalajs.js + +object Platform extends js.JSApp{ + def format(ts: Long) = { + new js.Date(ts).toLocaleString(); + } + def main() = { + println("simple.js") + val times = Seq( + System.currentTimeMillis(), + System.currentTimeMillis() + 1000, + System.currentTimeMillis() + 2000 + ) + println(Simple.formatTimestamps(times)) + } +}
\ No newline at end of file |