Class JsDate

java.lang.Object
com.google.gwt.core.client.JavaScriptObject
io.jmix.ui.widget.client.JsDate

public class JsDate extends com.google.gwt.core.client.JavaScriptObject
Wraps a JavaScript Date object.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static JsDate
    create(double milliseconds)
    Creates a new date with the specified internal representation, which is the number of milliseconds since midnight on January 1st, 1970.
    final long
    A wrapper for the JavaScript Date's getTime() method.
    static Date
    Converts a JsDate to a Java Date.
    static JsDate
    toJs(Date java)
    Converts a Java Date to a JsDate.

    Methods inherited from class com.google.gwt.core.client.JavaScriptObject

    cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JsDate

      protected JsDate()
  • Method Details

    • create

      public static JsDate create(double milliseconds)
      Creates a new date with the specified internal representation, which is the number of milliseconds since midnight on January 1st, 1970. This is the same representation returned by getTime().
    • toJava

      public static Date toJava(JsDate js)
      Converts a JsDate to a Java Date. If the JsDate is null, the function returns null.
      Parameters:
      js - A JsDate.
      Returns:
      A Java Date object, or null, if js is null.
    • toJs

      public static JsDate toJs(Date java)
      Converts a Java Date to a JsDate. If the Date is null, the function returns null.
      Parameters:
      java - A Java Date.
      Returns:
      An analogous JsDate, or null if the original Java Date was null.
    • getTimeMs

      public final long getTimeMs()
      A wrapper for the JavaScript Date's getTime() method.
      Returns:
      The time in milliseconds corresponding to this JsDate.