Intl.DurationFormat
Baseline
2025
Newly available
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Intl.DurationFormat ì ì¸ì´ì ë§ë ì§ì ìê° ììì ì§ìíë ê°ì²´ì
ëë¤.
ìì±ì
Intl.DurationFormat()-
ìë¡ì´
Intl.DurationFormatê°ì²´ë¥¼ ìì±í©ëë¤.
ì ì ë©ìë
Intl.DurationFormat.supportedLocalesOf()-
주ì´ì§ ë¡ì¼ì¼ ëª©ë¡ ì¤, ë°íìì´ ì§ìíë í목ì ë°°ì´ë¡ ë°íí©ëë¤.
ì¸ì¤í´ì¤ ìì±
ìëì ìì±ì Intl.DurationFormat.prototypeìì ì ìëì´ ìì¼ë©° 모ë Intl.DurationFormat ì¸ì¤í´ì¤ìì ê³µì ë©ëë¤.
Intl.DurationFormat.prototype.constructor-
ì¸ì¤í´ì¤ ê°ì²´ë¥¼ ë§ë ìì±ì í¨ìì ëë¤.
Intl.DurationFormatì¸ì¤í´ì¤ì ê²½ì° ì´ê¸° ê°ìIntl.DurationFormatìì±ìì ëë¤. Intl.DurationFormat.prototype[Symbol.toStringTag]-
[Symbol.toStringTag]ìì±ì ì´ê¸° ê°ì 문ìì´"Intl.DurationFormat"ì ëë¤. ì´ ìì±ìObject.prototype.toString()ìì ì¬ì©ë©ëë¤.
ì¸ì¤í´ì¤ ë©ìë
Intl.DurationFormat.prototype.format()-
DurationFormatê°ì²´ì ë¡ì¼ì¼ê³¼ ìì ìµì ì ë§ì¶° ì§ì ìê°ì ììíí´ ë°íí©ëë¤. Intl.DurationFormat.prototype.formatToParts()-
ììíë ì§ì ìê°ì ê° ë¶ë¶ ë¨ìë¡ ë¶í´íì¬ íííë ê°ì²´ì
Array를 ë°íí©ëë¤. Intl.DurationFormat.prototype.resolvedOptions()-
ê°ì²´ ì´ê¸°í ì¤ì ê³ì°ë ë¡ì¼ì¼ê³¼ ìì ìµì ì ë°ìí ìì±ì´ ìë ì ê°ì²´ë¥¼ ë°íí©ëë¤.
ìì
>Intl.DurationFormat ì¬ì©í기
ìëì ìì ë¤ì ë¤ìí ë¡ì¼ì¼ê³¼ ìì ìµì
ì ì¬ì©íì¬ Intl.DurationFormat ê°ì²´ë¡ ì§ì ìê° ê°ì²´ë¥¼ íìííë ë°©ë²ì ë³´ì¬ì¤ëë¤.
const duration = {
hours: 1,
minutes: 46,
seconds: 40,
};
// ìì ìµì
ì "long"ì¼ë¡ ì¤ì íê³ , ë¡ì¼ì¼ì "fr-FR"ë¡ ì¤ì
new Intl.DurationFormat("fr-FR", { style: "long" }).format(duration);
// "1 heure, 46 minutes et 40 secondes"
// ìì ìµì
ì "short"ì¼ë¡ ì¤ì íê³ , ë¡ì¼ì¼ì "en"ë¡ ì¤ì
new Intl.DurationFormat("en", { style: "short" }).format(duration);
// "1 hr, 46 min and 40 sec"
// ìì ìµì
ì "narrow"ì¼ë¡ ì¤ì íê³ , ë¡ì¼ì¼ì "pt"ë¡ ì¤ì
new Intl.DurationFormat("pt", { style: "narrow" }).format(duration);
// "1h 46 min 40s"
ëª ì¸ì
| Specification |
|---|
| Intl.DurationFormat> # durationformat-objects> |