From 5652bb76d46a0262cbf9149f4b1b2cb0709acf30 Mon Sep 17 00:00:00 2001 From: Zeng1998 Date: Sat, 15 Apr 2023 00:54:48 +0800 Subject: [PATCH] fix: incorrect date parsing (#1527) * fix: incorrect date parsing * fix eslint --- web/src/pages/DailyReview.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index 5f1e408c..49599816 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -1,4 +1,3 @@ -import dayjs from "dayjs"; import { last } from "lodash-es"; import { useEffect, useRef, useState } from "react"; import toast from "react-hot-toast"; @@ -78,9 +77,6 @@ const DailyReview = () => { toggleShowDatePicker(false); }; - const currentMonth = dayjs().format("MMM"); - const currentDayOfWeek = dayjs().format("ddd"); - return (
@@ -128,11 +124,11 @@ const DailyReview = () => {
{currentDate.getFullYear()}
- {currentMonth[0].toUpperCase() + currentMonth.substring(1)} + {currentDate.toLocaleString("en-US", { month: "short" })}
{currentDate.getDate()}
- {currentDayOfWeek[0].toUpperCase() + currentDayOfWeek.substring(1)} + {currentDate.toLocaleString("en-US", { weekday: "short" })}