Package io.deephaven.web.client.api
Class DateWrapper
java.lang.Object
io.deephaven.web.client.api.LongWrapper
io.deephaven.web.client.api.DateWrapper
Wraps a timestamp value stored as nanoseconds since the epoch for use in JS.
This type extends LongWrapper and inherits the following conversions:
LongWrapper.asNumber()for a numeric representationLongWrapper.toString()andLongWrapper.valueOf()for string representations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelemental2.core.JsDateasDate()Returns the wrapped timestamp as a JavaScriptJsDate.static DateWrapperof(long dateInNanos) static DateWrapperofJsDate(elemental2.core.JsDate date) Creates a wrapper from a JavaScriptJsDate.Methods inherited from class io.deephaven.web.client.api.LongWrapper
asNumber, equals, getWrapped, hashCode, ofString, toString, valueOf
-
Constructor Details
-
DateWrapper
@JsIgnore public DateWrapper(long valueInNanos)
-
-
Method Details
-
of
-
ofJsDate
Creates a wrapper from a JavaScriptJsDate.- Parameters:
date- The JavaScript date value.- Returns:
- A wrapper containing the corresponding timestamp in nanoseconds.
-
asDate
public elemental2.core.JsDate asDate()Returns the wrapped timestamp as a JavaScriptJsDate.- Returns:
- A
JsDaterepresenting the wrapped value.
-