Skip to content

scalajs-io/moment-range

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moment-range API for Scala.js

moment-range - Fancy date ranges for Moment.js.

Description

Fancy date ranges for Moment.js.

Build Dependencies

Build/publish the SDK locally

 $ sbt clean publish-local

Running the tests

Before running the tests the first time, you must ensure the npm packages are installed:

$ npm install

Then you can run the tests:

$ sbt test

Examples

import io.scalajs.npm.moment._
import io.scalajs.npm.moment.range._
import scala.scalajs.js

val moment = MomentRange.extendMoment(Moment)
val start = new js.Date(2012, 4, 1)
val end = new js.Date(2012, 4, 23)
val lol = new js.Date(2012, 4, 15)
val wat = new js.Date(2012, 4, 27)
val range = moment.range(start, end)
val range2 = moment.range(lol, wat)

range.contains(lol) // true
range.contains(wat) // false

Artifacts and Resolvers

To add the moment-range binding to your project, add the following to your build.sbt:

libraryDependencies += "io.scalajs.npm" %%% "moment-range" % "0.5.0"

Optionally, you may add the Sonatype Repository resolver:

resolvers += Resolver.sonatypeRepo("releases") 

About

Fancy date ranges for Moment.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages