Skip to content

Commit

Permalink
fix: getExpiredDate 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ppyom committed Dec 9, 2024
1 parent 26f0e34 commit a753291
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/utils/dayFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,16 @@ export const areDatesDifferent = (

export const getExpiredDate = (value: string): string => {
const now = dayjs().tz("Asia/Seoul");

if (value.includes("일")) {
const days = parseInt(value.replace("일 후", ""));
return now.add(days, "day").format("YYYY-MM-DDTHH:mm:ssZ");
return now.add(days, "day").format("YYYY-MM-DDTHH:mm:ss.SSS[Z]");
} else if (value.includes("시간")) {
const hours = parseInt(value.replace("시간 후", ""));
return now.add(hours, "hour").format("YYYY-MM-DDTHH:mm:ssZ");
return now.add(hours, "day").format("YYYY-MM-DDTHH:mm:ss.SSS[Z]");
} else {
return dayjs(value, "YYYY-MM-DD HH:mm:ss")
.tz("Asia/Seoul")
.format("YYYY-MM-DDTHH:mm:ssZ");
.format("YYYY-MM-DDTHH:mm:ss.SSS[Z]");
}
};

Expand Down

0 comments on commit a753291

Please sign in to comment.