fix(frontend): 서버 보정 시각을 로컬 시계로 표시
명령 목록 중앙 시계는 서버 게임 시각과 클라이언트 시각 차이를 보정해 흐르게 한다. 장수 다음 턴과 예약 행 시각도 브라우저 로컬 시간대로 투영한다.
This commit is contained in:
@@ -7,3 +7,11 @@ export const formatSeoulHourMinute = (value: string | Date): string =>
|
||||
|
||||
export const formatSeoulTimeSeconds = (value: string | Date): string =>
|
||||
formatServerDateTime(value, { format: 'timeSeconds' });
|
||||
|
||||
export const formatLocalTimeSeconds = (value: string | Date): string => {
|
||||
const parsed = value instanceof Date ? value : new Date(value);
|
||||
if (!Number.isFinite(parsed.getTime())) return '-';
|
||||
return [parsed.getHours(), parsed.getMinutes(), parsed.getSeconds()]
|
||||
.map((part) => String(part).padStart(2, '0'))
|
||||
.join(':');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user