Files
vexplor/frontend/lib/utils/localDate.ts
kjs ae4fe7a66e chore: update .gitignore and remove quick insert options from button configurations
- Added new entries to .gitignore for multi-agent MCP task queue and related rules.
- Removed "즉시 저장" (quick insert) options from the ScreenSettingModal and BasicTab components to streamline button configurations.
- Cleaned up unused event options in the V2ButtonConfigPanel to enhance clarity and maintainability.

These changes aim to improve project organization and simplify the user interface by eliminating redundant options.
2026-03-17 17:37:40 +09:00

31 lines
1.1 KiB
TypeScript

/**
* 로컬(한국) 시간 기준 날짜/시간 포맷 유틸리티
* DB 타임존이 Asia/Seoul로 설정되어 있어 로컬 시간 기준으로 포맷
*
* toISOString()은 항상 UTC를 반환하므로 자동값 생성 시 사용 금지
*/
export function toLocalDate(date: Date = new Date()): string {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, "0");
const d = String(date.getDate()).padStart(2, "0");
return `${y}-${m}-${d}`;
}
export function toLocalTime(date: Date = new Date()): string {
const h = String(date.getHours()).padStart(2, "0");
const min = String(date.getMinutes()).padStart(2, "0");
const sec = String(date.getSeconds()).padStart(2, "0");
return `${h}:${min}:${sec}`;
}
export function toLocalDateTime(date: Date = new Date()): string {
return `${toLocalDate(date)} ${toLocalTime(date)}`;
}
export function toLocalDateTimeForInput(date: Date = new Date()): string {
const h = String(date.getHours()).padStart(2, "0");
const min = String(date.getMinutes()).padStart(2, "0");
return `${toLocalDate(date)}T${h}:${min}`;
}