trait RelativeTimeFormat extends scala.scalajs.js.Object with StObject
- Alphabetic
- By Inheritance
- RelativeTimeFormat
- StObject
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): scala.Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): scala.Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): scala.Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): scala.Boolean
- Definition Classes
- AnyRef → Any
- def format(value: Double, unit: RelativeTimeFormatUnit): scala.Predef.String
Formats a value and a unit according to the locale and formatting options of the given [
Intl.RelativeTimeFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.Formats a value and a unit according to the locale and formatting options of the given [
Intl.RelativeTimeFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.While this method automatically provides the correct plural forms, the grammatical form is otherwise as neutral as possible. It is the caller's responsibility to handle cut-off logic such as deciding between displaying "in 7 days" or "in 1 week". This API does not support relative dates involving compound units. e.g "in 5 days and 4 hours".
- value
- Numeric value to use in the internationalized relative time message
- unit
- [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message. Possible values are:
"year","quarter","month","week","day","hour","minute","second". Plural forms are also permitted.
- Exceptions thrown
`RangeError`ifunitwas given something other thanunitpossible values
- def formatToParts(value: Double, unit: RelativeTimeFormatUnit): scala.scalajs.js.Array[RelativeTimeFormatPart]
A version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its constituent parts and separating it from other surrounding text.
A version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its constituent parts and separating it from other surrounding text. These objects have two properties:
typea NumberFormat formatToParts type, andvalue, which is the String which is the component of the output. If a "part" came from NumberFormat, it will have a unit property which indicates theunitbeing formatted; literals which are part of the larger frame will not have this property.- value
- Numeric value to use in the internationalized relative time message
- unit
- [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message. Possible values are:
"year","quarter","month","week","day","hour","minute","second". Plural forms are also permitted.
- Exceptions thrown
`RangeError`ifunitwas given something other thanunitpossible values
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hasOwnProperty(v: scala.Predef.String): scala.Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: scala.Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: scala.scalajs.js.Object): scala.Boolean
- Definition Classes
- Object
- final def ne(arg0: AnyRef): scala.Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def propertyIsEnumerable(v: scala.Predef.String): scala.Boolean
- Definition Classes
- Object
- def resolvedOptions(): ResolvedRelativeTimeFormatOptions
Provides access to the locale and options computed during initialization of this
Intl.RelativeTimeFormatobject. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): scala.Predef.String
- Definition Classes
- Object
- def toString(): java.lang.String
- Definition Classes
- AnyRef → Any
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated