Skip to content

ascendtech/gwt-momentjs

Repository files navigation

gwt-momentjs

Light JSInterop wrapper for moment.js

Getting Started

Gradle

Add AST Maven Repo

  allprojects {
    repositories {
      ...
      maven { url 'https://maven.ascend-tech.us/repo' }
    }
  }

Add Dependency:

  compile 'us.ascendtech:momentjs:0.1.9'
  compile 'us.ascendtech:momentjs:0.1.9:sources'

Maven

Add JitPack

  <repositories>
    <repository>
      <id>AST Maven</id>
      <url>https://maven.ascend-tech.us/repo</url>
    </repository>
  </repositories>

Add Dependency

  <dependency>
    <groupId>us.ascendtech</groupId>
    <artifactId>momentjs</artifactId>
    <version>0.1.9</version>
  </dependency>
  <dependency>
    <groupId>us.ascendtech</groupId>
    <artifactId>momentjs</artifactId>
    <version>0.1.9</version>
    <classifier>sources</classifier>
  </dependency>

Example in Java

Add dependency to gwt.xml

<inherits name="us.ascendtech.MomentJS"/>
double year = new MomentJS().year();
String formattedDate = new MomentJS().format("MM-DD-YYYY");