From 65b84b16cafb1356bcd865da512fff6d6532dadc Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Wed, 5 Feb 2025 18:45:08 +0700 Subject: [PATCH] update TypeUploadSingle.tsx and date.ts --- components/form/field/TypeUploadSingle.tsx | 4 +++- utils/date.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/form/field/TypeUploadSingle.tsx b/components/form/field/TypeUploadSingle.tsx index b855849..532ad37 100644 --- a/components/form/field/TypeUploadSingle.tsx +++ b/components/form/field/TypeUploadSingle.tsx @@ -84,7 +84,9 @@ export const FieldUploadSingle: FC<{ .pop()}`; input.isLocal = true; input.render(); - console.log(input.preview); + if (typeof on_change === "function") { + on_change({}); + } return; const formData = new FormData(); formData.append("file", file); diff --git a/utils/date.ts b/utils/date.ts index 0538258..e665162 100644 --- a/utils/date.ts +++ b/utils/date.ts @@ -42,14 +42,14 @@ export const timeAgo = (date: string | Date) => { }; export const formatTime = (date: string | Date) => { if (date instanceof Date || typeof date === "string") { - return day(date).format("hh:mm"); + return day(date).format("HH:mm"); } return "-"; }; export const time = (date: string | Date) => { if (date instanceof Date || typeof date === "string") { - return day(date).format("hh:mm"); + return day(date).format("HH:mm"); } return null; };