| 8 | |
| 9 | // Format date as yyyy-MM-dd HH_mm_ss_SSS |
| 10 | function formatDate(date: Date) { |
| 11 | const year = date.getFullYear(); |
| 12 | const month = date.getMonth() + 1; |
| 13 | const day = date.getDate(); |
| 14 | const hours = date.getHours(); |
| 15 | const minutes = date.getMinutes(); |
| 16 | const seconds = date.getSeconds(); |
| 17 | const milliseconds = date.getMilliseconds(); |
| 18 | |
| 19 | return `${year}-${month.toString().padStart(2, "0")}-${day.toString().padStart(2, "0")} ${hours |
| 20 | .toString() |
| 21 | .padStart(2, "0")}_${minutes.toString().padStart(2, "0")}_${seconds |
| 22 | .toString() |
| 23 | .padStart(2, "0")}_${milliseconds.toString().padStart(3, "0")}`; |
| 24 | } |
| 25 | |
| 26 | export async function loader({ request }: DataFunctionArgs) { |
| 27 | const user = await requireUser(request); |