TypeTags .IntlRelativeTimeFormat
Overview
The Intl.RelativeTimeFormat
object enables language-sensitive relative time formatting.
Usage
import { TypeTags } from 'typetags'
const rtf = new Intl.RelativeTimeFormat('en', { style: 'narrow' })
TypeTags.IntlRelativeFormat === TypeTags.get(rtf)// → true
console.log(rtf.format(3, 'quarter'))// expected output: 'in 3 qtrs.'
Predicate
.isIntlPluralRules(value)
- Checks if
value
is or has a defaultIntlPluralRules
type tag.
const { TypeTags } = require('typetags')
const formatter = new Intl.PluralRules('en-GB')
TypeTags.isIntlPluralRules(formatter)// → true
Metadata (TType)
Metadata | Value |
---|---|
.type | Intl.RelativeTimeFormat |
.tag | [object Intl.RelativeTimeFormat] |
.builtin() | undefined |
.getTag() | [object Intl.RelativeTimeFormat] |
.hasSpecialArgs() | false |
.instance() | undefined |
.instanceTypeOf() | object |
.info() | see more |
.isAvailable() | true |
.isConstructor() | true |
.isFactory() | false |
.isFunction() | true |
.isGlobal() | false |
.isIterator() | false |
.isNested() | true |
.isObject() | false |
.isPrimitive() | false |
.isStringifiable() | true |
.isSyntatic() | false |
.isTypedArray() | false |
.ownKeys() | [length, name, prototype, supportedLocalesOf] |
.toString() | function toString() { [native code] } |
.typeOf() | function |
Signature
declare type ITypeTags = { [key in Types | NestedTypes]: Tags}
declare interface Predicate { predicate(value: any): boolean}