Skip to main content

Relative Time

shadow

Komponent RelativeTime je element slúžiaci na zobrazenie relatívneho času na základe vloženého dátumu. Vypočíta a zobrazí relatívny časový rozdiel medzi aktuálnym dátumom a zadaným dátumom. Formát relatívneho času je lokalizovaný na základe jazyka prehliadača používateľa.

Základné použitie

Atribúty a Vlastnosti

date

DescriptionSets the date of the relative time component.
Attributedate
Typestring
Defaultundefined

window

DescriptionSets the language of the relative time component.
Attributewindow
Typestring
Defaultundefined

Eventy

No events available for this component.

Metódy

getRelativeTimeString

DescriptionReturns the relative time string for the specified date.
SignaturegetRelativeTimeString(lang = navigator.language) => string

isISODate

DescriptionChecks if the string is in ISO date format.
SignatureisISODate(str) => boolean

CSS Shadow Parts

NameDescription
nativeRefers to div inside an element.

CSS Custom Vlastnosti

No CSS custom properties available for this component.

Sloty

No slots available for this component.