dify/web/features/deployments/shared/domain/release.ts
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

21 lines
562 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) : '—'
}