Files
dify/web/app/components/workflow/utils/common.ts
+18 107bba0116 feat: dev snippet fronted (#36784)
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: EvanYao826 <[email protected]>
Co-authored-by: yyh <[email protected]>
Co-authored-by: 盐粒 Yanli <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianle <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yunlu Wen <[email protected]>
Co-authored-by: zyssyz123 <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: chariri <[email protected]>
Co-authored-by: Asuka Minato <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Nian <[email protected]>
Co-authored-by: 非法操作 <[email protected]>
Co-authored-by: Carmen Fernández Ruiz <[email protected]>
Co-authored-by: wangxiaolei <[email protected]>
Co-authored-by: QuantumGhost <[email protected]>
Co-authored-by: L1nSn0w <[email protected]>
Co-authored-by: Evan <[email protected]>
Co-authored-by: Escape0707 <[email protected]>
Co-authored-by: Jingyi <[email protected]>
Co-authored-by: Amr Sherif <[email protected]>
Co-authored-by: ZHOU ZHICHEN <[email protected]>
Co-authored-by: unknown <[email protected]>
Co-authored-by: JzoNg <[email protected]>
Co-authored-by: Xiyuan Chen <[email protected]>
Co-authored-by: -LAN- <[email protected]>
2026-05-28 17:34:14 +08:00

21 lines
711 B
TypeScript

/**
* Format workflow run identifier using finished_at timestamp
* @param finishedAt - Unix timestamp in seconds
* @param fallbackText - Text to show when finishedAt is not available (default: 'Running')
* @returns Formatted string like " (14:30:25)" or " (Running)"
*/
export const formatWorkflowRunIdentifier = (finishedAt?: number, fallbackText = 'Running'): string => {
if (!finishedAt) {
const capitalized = fallbackText.charAt(0).toUpperCase() + fallbackText.slice(1)
return ` (${capitalized})`
}
const date = new Date(finishedAt * 1000)
const timeStr = date.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
return ` (${timeStr})`
}