dify/web/features/deployments/shared/domain/release.ts
Stephen Zhou 48452aefbc
feat: app deploy (#35670)
Co-authored-by: zhangx1n <zhangxin@dify.ai>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-17 09:28:43 +00:00

18 lines
538 B
TypeScript

import type { Release } from '@dify/contracts/enterprise/types.gen'
import { formatTime } from '@/utils/time'
export function formatDate(value?: string) {
if (!value)
return '—'
const date = new Date(value)
if (Number.isNaN(date.getTime()))
return value.replace('T', ' ').replace(/\.\d+Z?$/, '').replace(/Z$/, '').slice(0, 16)
return formatTime({ date, dateFormat: 'YYYY-MM-DD HH:mm' })
}
export function releaseCommit(release?: Release) {
return release?.gateCommitId ? release.gateCommitId.slice(0, 8) : '—'
}