Example usage for com.google.gwt.core.client JsDate parse

List of usage examples for com.google.gwt.core.client JsDate parse

Introduction

In this page you can find the example usage for com.google.gwt.core.client JsDate parse.

Prototype

public static native double parse(String dateString) ;

Source Link

Document

Parses a string representation of a date and time and returns the internal millisecond representation.

Usage

From source file:com.cgxlib.xq.client.builders.XmlBuilderBase.java

License:Apache License

public Date getTextAsDate() {
    String t = g.text().trim();// w w w .j  a va2  s.  co  m
    if (t.matches("\\d+")) {
        return new Date(Long.parseLong(t));
    } else {
        return new Date((long) JsDate.parse(t));
    }
}

From source file:java.util.Date.java

License:Apache License

public static long parse(String s) {
    double parsed = JsDate.parse(s);
    if (Double.isNaN(parsed)) {
        throw new IllegalArgumentException();
    }// www . j a  va  2 s .  c  om
    return (long) parsed;
}

From source file:org.jboss.errai.databinding.client.api.converter.AbstractDateInputConverter.java

License:Apache License

@Override
public Date toModelValue(final String widgetValue) {
    if (widgetValue == null || "".equals(widgetValue)) {
        return null;
    }/*from w w w  . java2  s  .  co  m*/

    final Double time = JsDate.parse(widgetValue);
    return new Date(time.longValue());
}