export function todayIso(): string {
  return new Date().toLocaleDateString('en-CA')
}

export function formatDate(dateValue: string): string {
  const date = new Date(dateValue)
  return new Intl.DateTimeFormat('zh-CN', {
    month: 'long',
    day: 'numeric',
    weekday: 'short',
  }).format(date)
}

export function formatDateCompact(dateValue: string): string {
  const date = new Date(dateValue)
  return new Intl.DateTimeFormat('zh-CN', {
    month: 'numeric',
    day: 'numeric',
  }).format(date)
}

export function formatDateTime(dateValue: string): string {
  const date = new Date(dateValue)
  return new Intl.DateTimeFormat('zh-CN', {
    month: 'numeric',
    day: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
    hour12: false,
  }).format(date)
}

export function formatClock(dateValue: string): string {
  const date = new Date(dateValue)
  return new Intl.DateTimeFormat('zh-CN', {
    hour: '2-digit',
    minute: '2-digit',
    hour12: false,
  }).format(date)
}
