/*
 * @Author: chris
 * @Date: 2026-01-19 17:35:18
 * @LastEditors: chris
 * @LastEditTime: 2026-01-19 17:38:51
 */
export function formatDate(cellValue: string | number): string {
  if (cellValue == null || cellValue === '')
    return ''
  const date = new Date(cellValue)
  const year = date.getFullYear()
  const month
    = date.getMonth() + 1 < 10
      ? `0${date.getMonth() + 1}`
      : date.getMonth() + 1
  const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()
  const hours = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
  const minutes
    = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()
  const seconds
    = date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()
  return (
    `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  )
}
