Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone committed Apr 8, 2024
1 parent 6559ebc commit 0dbb3c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/format.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isValid } from "date-fns";
import { ja } from "date-fns/locale";
import { format as formatFn, utcToZonedTime } from "date-fns-tz";
import { format as formatFn, toZonedTime } from "date-fns-tz";

const timeZone = "Asia/Tokyo";

Expand All @@ -10,7 +10,7 @@ const timeZone = "Asia/Tokyo";
* see https://date-fns.org/v2.29.3/docs/format
*/
export const formatDateTime = (value: string, format: string): string => {
const parsedDate = utcToZonedTime(value, timeZone);
const parsedDate = toZonedTime(value, timeZone);

if (!isValid(parsedDate)) return "";

Expand Down

0 comments on commit 0dbb3c4

Please sign in to comment.