秒數 → 人類可讀(中文/英文)。例: 7325 → "2 小時 2 分鐘 5 秒" / "2h 2m 5s"。
參數
| 參數 | 型別 | 說明 |
|---|---|---|
| seconds * | number | — |
| language | "zh-tw" | "en" | — |
原始 JSON schema
{
"properties": {
"seconds": {
"title": "Seconds",
"type": "number"
},
"language": {
"default": "zh-tw",
"enum": [
"zh-tw",
"en"
],
"title": "Language",
"type": "string"
}
},
"required": [
"seconds"
],
"title": "duration_humanizeArguments",
"type": "object",
"additionalProperties": false
}呼叫方式
起手式——參數見上表
tw_duration_humanize({ seconds: 10 })