chore(lps-admin): 폴더명 lps-temp-fe → lps-admin
임시 FE 가 정식 관리자 콘솔이 되어 이름을 용도에 맞게 변경. 루트 병렬 유지(lps/ 는 파이썬 백엔드 루트라 중첩 시 비대칭 + Docker 빌드 컨텍스트 오염). package.json name 동기화. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6eb71eb035
commit
992a3246a8
21 files changed
+1
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
/** 표시 포맷 유틸 — 원화·달러·상대시각·소요시간. */
|
||||
|
||||
export const won = (v?: number | null) =>
|
||||
v === null || v === undefined ? "—" : `${v.toLocaleString("ko-KR")}원`;
|
||||
|
||||
export const usd = (v?: number | null, digits = 3) =>
|
||||
v === null || v === undefined ? "—" : `$${v.toFixed(digits)}`;
|
||||
|
||||
export function timeAgo(iso?: string | null): string {
|
||||
if (!iso) return "—";
|
||||
const sec = Math.max(0, (Date.now() - new Date(iso).getTime()) / 1000);
|
||||
if (sec < 60) return `${Math.floor(sec)}초 전`;
|
||||
if (sec < 3600) return `${Math.floor(sec / 60)}분 전`;
|
||||
if (sec < 86400) return `${Math.floor(sec / 3600)}시간 전`;
|
||||
return `${Math.floor(sec / 86400)}일 전`;
|
||||
}
|
||||
|
||||
export const hhmm = (iso: string) =>
|
||||
new Date(iso).toLocaleTimeString("ko-KR", { hour: "2-digit", minute: "2-digit", hour12: false });
|
||||
|
||||
export const dateShort = (iso: string) =>
|
||||
new Date(iso).toLocaleString("ko-KR", { month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: false });
|
||||
|
||||
export function durationSec(sec?: number | null): string {
|
||||
if (sec === null || sec === undefined) return "—";
|
||||
if (sec < 60) return `${sec}초`;
|
||||
if (sec < 3600) return `${Math.floor(sec / 60)}분 ${sec % 60}초`;
|
||||
return `${Math.floor(sec / 3600)}시간 ${Math.floor((sec % 3600) / 60)}분`;
|
||||
}
|
||||
Reference in new issue
Block a user