(dateString: string)
| 113 | } |
| 114 | |
| 115 | function formatFullDate(dateString: string): string { |
| 116 | return new Intl.DateTimeFormat("zh-CN", { |
| 117 | dateStyle: "medium", |
| 118 | timeStyle: "short", |
| 119 | }).format(new Date(dateString)); |
| 120 | } |
| 121 | |
| 122 | function formatRelativeTime(dateString: string): string { |
| 123 | const diffMs = new Date(dateString).getTime() - Date.now(); |