update TypeUploadSingle.tsx and date.ts

This commit is contained in:
faisolavolut 2025-02-05 18:45:08 +07:00
parent 1d2ef1074c
commit 65b84b16ca
2 changed files with 5 additions and 3 deletions

View File

@ -84,7 +84,9 @@ export const FieldUploadSingle: FC<{
.pop()}`; .pop()}`;
input.isLocal = true; input.isLocal = true;
input.render(); input.render();
console.log(input.preview); if (typeof on_change === "function") {
on_change({});
}
return; return;
const formData = new FormData(); const formData = new FormData();
formData.append("file", file); formData.append("file", file);

View File

@ -42,14 +42,14 @@ export const timeAgo = (date: string | Date) => {
}; };
export const formatTime = (date: string | Date) => { export const formatTime = (date: string | Date) => {
if (date instanceof Date || typeof date === "string") { if (date instanceof Date || typeof date === "string") {
return day(date).format("hh:mm"); return day(date).format("HH:mm");
} }
return "-"; return "-";
}; };
export const time = (date: string | Date) => { export const time = (date: string | Date) => {
if (date instanceof Date || typeof date === "string") { if (date instanceof Date || typeof date === "string") {
return day(date).format("hh:mm"); return day(date).format("HH:mm");
} }
return null; return null;
}; };