feat: refine sftp pane upload workflow
This commit is contained in:
@@ -28,8 +28,20 @@ export function formatTimestamp(timestamp?: number | null) {
|
||||
return new Date(timestamp).toLocaleString()
|
||||
}
|
||||
|
||||
export function formatSftpDate(epochSeconds: number) {
|
||||
return new Date(epochSeconds * 1000).toLocaleString()
|
||||
export function formatSftpDate(timestampMs?: number | null) {
|
||||
if (timestampMs == null || Number.isNaN(timestampMs)) return '-'
|
||||
|
||||
const date = new Date(timestampMs)
|
||||
if (Number.isNaN(date.getTime())) return '-'
|
||||
|
||||
const year = String(date.getFullYear())
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
}
|
||||
|
||||
export function formatSftpPermissions(entry: { directory: boolean }) {
|
||||
|
||||
Reference in New Issue
Block a user