mirror of
https://github.com/langgenius/dify.git
synced 2026-06-22 03:01:10 +08:00
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>
18 lines
538 B
TypeScript
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) : '—'
|
|
}
|