Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/shared/lib/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ export const formatDateLocalString = (date: Date, time: string): string => {
return `${year}-${month}-${day}T${hour}:${minute}:00`;
};

export const formatUtcToKst = (utcString: string): string => {
const utcDate = new Date(utcString);

const kstTimestamp = utcDate.getTime() + 9 * 60 * 60 * 1000;
const kstDate = new Date(kstTimestamp);
export const formatLst = (utcString: string): string => {
const kstDate = new Date(utcString);

const year = kstDate.getFullYear();
const month = (kstDate.getMonth() + 1).toString().padStart(2, '0');
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/dashboard/ui/email/SentMailCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import arrow from '../../../../../public/assets/dashboard/mail/Arrow.svg';
import { useState } from 'react';
import IconButton from '../../../../../design-system/ui/buttons/IconButton';
import { formatUtcToKst } from '../../../../shared/lib/date';
import { formatLst } from '../../../../shared/lib/date';
import TertiaryButton from '../../../../../design-system/ui/buttons/TertiaryButton';
import { useNavigate, useParams } from 'react-router-dom';
import { ReadEmailResponse } from '../../../../features/dashboard/model/email';
Expand Down Expand Up @@ -38,7 +38,7 @@ const SentMailCard = ({ mail, isPending = false, onClickDelete }: SentMailCardPr
<p>{mail.title}</p>
</div>
<p className="text-sm text-placeholderText">
{formatUtcToKst(mail.reservationDate)}
{formatLst(mail.reservationDate)}
</p>
</div>
<IconButton
Expand Down