Skip to content

Commit

Permalink
Merge pull request #133 from Kyutech-C3/fix/#132-date-time-zone
Browse files Browse the repository at this point in the history
fix:表示時間をマイナス9時間 #132
  • Loading branch information
tosaken1116 authored Jul 13, 2023
2 parents 0c40c3c + ba340b3 commit 46a36f1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Common/Date/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ import { format, parseISO } from "date-fns";
const Date = ({ dateString, size }: DateProps) => {
const date = parseISO(dateString);
return (
<Typography sx={{ placeSelf: "center", fontSize: size == "s" ? "12px" : size == "m" ? "16px" : "20px" }}>
{dateString != "" ? format(date, "yyyy/MM/dd HH:mm") : ""}
<Typography
sx={{
placeSelf: "center",
fontSize: size == "s" ? "12px" : size == "m" ? "16px" : "20px",
}}
>
{dateString != ""
? format(
date.setTime(date.getTime() - 9 * 60 * 60 * 1000),
"yyyy/MM/dd HH:mm"
)
: ""}
</Typography>
);
};
Expand Down

0 comments on commit 46a36f1

Please sign in to comment.