public final class JSDate extends JSNonProxy implements JSConstructorFactory.WithFunctions, PrototypeSupplier
usesOrdinaryGetOwnPropertyJSConstructorFactory.Default, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies| Modifier and Type | Field and Description |
|---|---|
static com.oracle.truffle.api.strings.TruffleString |
CLASS_NAME |
static JSDate |
INSTANCE |
static com.oracle.truffle.api.strings.TruffleString |
INVALID_DATE_STRING |
static double |
MAX_DATE |
static double |
MAX_YEAR_VALUE |
static int |
MS_PER_DAY |
static int |
MS_PER_HOUR |
static int |
MS_PER_MINUTE |
static int |
MS_PER_SECOND |
static com.oracle.truffle.api.strings.TruffleString |
PROTOTYPE_NAME |
GET_SYMBOL_SPECIES_NAME| Modifier and Type | Method and Description |
|---|---|
static Instant |
asInstant(JSDateObject date) |
static LocalDate |
asLocalDate(JSDateObject date,
JSRealm realm) |
static LocalTime |
asLocalTime(JSDateObject date,
JSRealm realm) |
static JSDateObject |
create(JSContext context,
JSRealm realm,
double timeMillis) |
static JSDateObject |
create(JSContext context,
JSRealm realm,
JSDynamicObject proto,
double timeMillis) |
static JSConstructor |
createConstructor(JSRealm realm) |
JSDynamicObject |
createPrototype(JSRealm realm,
JSFunctionObject ctor) |
static int |
dateFromDayInYear(int year,
int day) |
static int |
dateFromTime(double dt) |
static double |
day(double t) |
static int |
dayFromYear(int y) |
static double |
executeConstructor(double[] argsEvaluated,
boolean inputIsUTC) |
static com.oracle.truffle.api.strings.TruffleString |
format(org.graalvm.shadowed.com.ibm.icu.text.DateFormat format,
double time) |
com.oracle.truffle.api.strings.TruffleString |
getBuiltinToStringTag(JSDynamicObject object)
Returns builtinTag from step 14 of ES6+ 19.1.3.6.
|
com.oracle.truffle.api.strings.TruffleString |
getClassName() |
com.oracle.truffle.api.strings.TruffleString |
getClassName(JSDynamicObject object)
The [[Class]] internal property.
|
static double |
getDateValueFromInstant(Object receiver,
com.oracle.truffle.api.interop.InteropLibrary interop) |
JSDynamicObject |
getIntrinsicDefaultProto(JSRealm realm)
Allows invokevirtual of this method instead of invokeinterface.
|
static double |
getTimeMillisField(JSDateObject obj) |
static int |
hourFromTime(double t) |
static boolean |
isJSDate(Object obj) |
static boolean |
isTimeValid(double time) |
static boolean |
isValidDate(JSDateObject date) |
static double |
localTime(double t,
com.oracle.truffle.api.nodes.Node node) |
static long |
localTZA(double t,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static int |
localTZA(double t,
boolean isUTC,
org.graalvm.shadowed.com.ibm.icu.util.TimeZone timeZone) |
static double |
makeDate(double day,
double time) |
static double |
makeDate(double y,
double m,
double d,
double h,
double min,
double sec,
double ms,
Integer timezone) |
static double |
makeDay(double year,
double month,
double date) |
com.oracle.truffle.api.object.Shape |
makeInitialShape(JSContext ctx,
JSDynamicObject prototype) |
static double |
makeTime(double hour,
double min,
double sec,
double ms) |
static int |
minFromTime(double t) |
static int |
monthFromTime(double dt) |
static int |
msFromTime(double t) |
static int |
secFromTime(double t) |
static double |
setDate(JSDateObject thisDate,
double date,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setFullYear(JSDateObject thisDate,
double year,
double month,
boolean monthSpecified,
double date,
boolean dateSpecified,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setHours(JSDateObject thisDate,
double h,
double m,
boolean mSpecified,
double s,
boolean sSpecified,
double ms,
boolean msSpecified,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setMilliseconds(JSDateObject thisDate,
double ms,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setMinutes(JSDateObject thisDate,
double m,
double s,
boolean sSpecified,
double ms,
boolean msSpecified,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setMonth(JSDateObject thisDate,
double month,
double date,
boolean dateSpecified,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setSeconds(JSDateObject thisDate,
double s,
double ms,
boolean msSpecified,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node) |
static double |
setTime(JSDateObject thisDate,
double time) |
static void |
setTimeMillisField(JSDateObject obj,
double timeMillis) |
static double |
setYear(JSDateObject thisDate,
double year,
com.oracle.truffle.api.nodes.Node node) |
static double |
timeClip(double time)
Implementation of ECMAScript 5.1 15.9.1.14 TimeClip.
|
com.oracle.truffle.api.strings.TruffleString |
toDisplayStringImpl(JSDynamicObject obj,
boolean allowSideEffects,
ToDisplayStringFormat format,
int depth)
A more informative toString variant, mainly used for error messages.
|
static com.oracle.truffle.api.strings.TruffleString |
toISOStringIntl(double time,
JSRealm realm) |
static com.oracle.truffle.api.strings.TruffleString |
toString(double time,
JSRealm realm) |
static double |
weekDay(double t) |
static int |
yearFromDays(int daysAfter1970) |
static int |
yearFromTime(long t) |
checkProtoCycle, createSymbolSpeciesGetterFunction, defineOwnProperty, delete, delete, deletePropertyDefault, getHelper, getHelper, getMethodHelper, getOwnHelper, getOwnHelper, getOwnProperty, getOwnPropertyKeys, getPrototypeOf, hasOnlyShapeProperties, hasOwnProperty, hasOwnProperty, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryIsExtensible, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, preventExtensions, preventExtensionsImpl, putConstructorSpeciesGetter, set, set, setIntegrityLevel, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevel, testIntegrityLevelFast, toString, usesOrdinaryGetOwnProperty, usesOrdinaryIsExtensibledefaultToString, filterOwnPropertyKeys, formatToString, get, get, getToStringTag, isInstance, isInstance, isInstance, isInstance, ownPropertyKeys, testIntegrityLevelDefaultclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateConstructorAndPrototypecreateConstructorObject, fillConstructorpublic static final com.oracle.truffle.api.strings.TruffleString CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString PROTOTYPE_NAME
public static final JSDate INSTANCE
public static final int MS_PER_SECOND
public static final int MS_PER_MINUTE
public static final int MS_PER_HOUR
public static final int MS_PER_DAY
public static final double MAX_DATE
public static final double MAX_YEAR_VALUE
public static final com.oracle.truffle.api.strings.TruffleString INVALID_DATE_STRING
public static void setTimeMillisField(JSDateObject obj, double timeMillis)
public static double getTimeMillisField(JSDateObject obj)
public static boolean isJSDate(Object obj)
public com.oracle.truffle.api.strings.TruffleString getClassName()
getClassName in interface JSConstructorFactorypublic com.oracle.truffle.api.strings.TruffleString getClassName(JSDynamicObject object)
JSClassgetClassName in class JSClassobject - object to be usedpublic com.oracle.truffle.api.strings.TruffleString getBuiltinToStringTag(JSDynamicObject object)
JSClassgetBuiltinToStringTag in class JSNonProxyobject - object to be usedJSClass.defaultToString(JSDynamicObject)public JSDynamicObject createPrototype(JSRealm realm, JSFunctionObject ctor)
createPrototype in interface JSConstructorFactorypublic com.oracle.truffle.api.object.Shape makeInitialShape(JSContext ctx, JSDynamicObject prototype)
makeInitialShape in class JSClasspublic static JSConstructor createConstructor(JSRealm realm)
public static double executeConstructor(double[] argsEvaluated,
boolean inputIsUTC)
public static double day(double t)
public static int dayFromYear(int y)
public static int yearFromTime(long t)
public static int yearFromDays(int daysAfter1970)
public static int monthFromTime(double dt)
public static int dateFromTime(double dt)
public static int dateFromDayInYear(int year,
int day)
public static double weekDay(double t)
public static double localTime(double t,
com.oracle.truffle.api.nodes.Node node)
public static long localTZA(double t,
boolean isUTC,
com.oracle.truffle.api.nodes.Node node)
public static int localTZA(double t,
boolean isUTC,
org.graalvm.shadowed.com.ibm.icu.util.TimeZone timeZone)
public static int hourFromTime(double t)
public static int minFromTime(double t)
public static int secFromTime(double t)
public static int msFromTime(double t)
public static double makeTime(double hour,
double min,
double sec,
double ms)
public static double makeDay(double year,
double month,
double date)
public static double makeDate(double day,
double time)
public static double makeDate(double y,
double m,
double d,
double h,
double min,
double sec,
double ms,
Integer timezone)
public static double timeClip(double time)
public static JSDateObject create(JSContext context, JSRealm realm, double timeMillis)
public static JSDateObject create(JSContext context, JSRealm realm, JSDynamicObject proto, double timeMillis)
public static double setTime(JSDateObject thisDate, double time)
public static double setMilliseconds(JSDateObject thisDate, double ms, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setSeconds(JSDateObject thisDate, double s, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setMinutes(JSDateObject thisDate, double m, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setHours(JSDateObject thisDate, double h, double m, boolean mSpecified, double s, boolean sSpecified, double ms, boolean msSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setDate(JSDateObject thisDate, double date, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setMonth(JSDateObject thisDate, double month, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setFullYear(JSDateObject thisDate, double year, double month, boolean monthSpecified, double date, boolean dateSpecified, boolean isUTC, com.oracle.truffle.api.nodes.Node node)
public static double setYear(JSDateObject thisDate, double year, com.oracle.truffle.api.nodes.Node node)
public static com.oracle.truffle.api.strings.TruffleString format(org.graalvm.shadowed.com.ibm.icu.text.DateFormat format,
double time)
public static com.oracle.truffle.api.strings.TruffleString toString(double time,
JSRealm realm)
public static com.oracle.truffle.api.strings.TruffleString toISOStringIntl(double time,
JSRealm realm)
public static boolean isTimeValid(double time)
public static boolean isValidDate(JSDateObject date)
public static Instant asInstant(JSDateObject date)
public static LocalDate asLocalDate(JSDateObject date, JSRealm realm)
public static LocalTime asLocalTime(JSDateObject date, JSRealm realm)
public static double getDateValueFromInstant(Object receiver, com.oracle.truffle.api.interop.InteropLibrary interop)
public com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth)
JSClasstoDisplayStringImpl in class JSNonProxyformat - formatting parametersdepth - current nesting depthpublic JSDynamicObject getIntrinsicDefaultProto(JSRealm realm)
JSClassPrototypeSupplier.getIntrinsicDefaultProto in interface PrototypeSuppliergetIntrinsicDefaultProto in class JSClassPrototypeSupplier.getIntrinsicDefaultProto(com.oracle.truffle.js.runtime.JSRealm)