import { clsx, type ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; /** 合并 className:clsx 处理条件类,tailwind-merge 消解冲突的 Tailwind 类 */ export function cn(...inputs: ClassValue[]): string { return twMerge(clsx(inputs)); } /** 将日期格式化为中文可读形式,如 2025 年 3 月 8 日 */ export function formatDate(date: string, locale = "zh-CN"): string { return new Intl.DateTimeFormat(locale, { year: "numeric", month: "long", day: "numeric", timeZone: "UTC", }).format(new Date(`${date}T00:00:00Z`)); } /** 机器可读日期,用于