[st] - feat: realgrid 셀 편집 체크 설정 수정, 컴포넌트 url 방식 테스트 중
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/** API·DB 8자리 일자(yyyyMMdd) → 그리드·date 편집기용 yyyy-MM-dd */
|
||||
export function formatCompactYmdForGrid(ymd: string | number | null | undefined): string {
|
||||
const s = String(ymd ?? "").replace(/\D/g, "");
|
||||
if (s.length !== 8) return String(ymd ?? "").trim();
|
||||
return `${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}`;
|
||||
}
|
||||
|
||||
/** 그리드 값 → API 8자리 일자(yyyyMMdd) */
|
||||
export function toCompactYmd(value: string | number | null | undefined): string {
|
||||
const s = String(value ?? "").replace(/\D/g, "");
|
||||
if (s.length !== 8) return "";
|
||||
return s;
|
||||
}
|
||||
|
||||
/** 설치목적 등 O/X 표기 → 대문자 O 또는 X (그 외는 원문 유지) */
|
||||
export function normalizeOxYnValue(
|
||||
value: string | number | null | undefined,
|
||||
): string {
|
||||
const v = String(value ?? "").trim().toUpperCase();
|
||||
if (v === "O" || v === "X") return v;
|
||||
return String(value ?? "").trim();
|
||||
}
|
||||
Reference in New Issue
Block a user