From 1ab9bb1dbcf924132649276f66688ab75ac2f8c9 Mon Sep 17 00:00:00 2001 From: suzinxix Date: Tue, 31 Jan 2023 22:52:09 +0900 Subject: [PATCH] [#46] fix: correct variable --- bowwowcare/src/App.js | 1 - bowwowcare/src/utils/Calculator.js | 10 +++++----- bowwowcare/src/views/HomePage/HomePage.js | 2 +- bowwowcare/src/views/HomePage/PetList/PetList.js | 8 ++++---- .../HomePage/PetList/{PetInfo => Sections}/PetInfo.js | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) rename bowwowcare/src/views/HomePage/PetList/{PetInfo => Sections}/PetInfo.js (89%) diff --git a/bowwowcare/src/App.js b/bowwowcare/src/App.js index e93b345..12f2733 100644 --- a/bowwowcare/src/App.js +++ b/bowwowcare/src/App.js @@ -14,7 +14,6 @@ import LoginPage from './views/LoginPage/LoginPage'; import SignupPage from './views/SignupPage/SignupPage'; import AdditionPage from "./views/AdditionPage/AdditionPage"; import PrivateRoute from "./PrivateRoute"; -import PetInfo from "./views/HomePage/PetList/PetInfo/PetInfo"; import PetInfoPage from "./views/PetInfoPage/PetInfoPage"; import { logout } from "./slices/auth"; diff --git a/bowwowcare/src/utils/Calculator.js b/bowwowcare/src/utils/Calculator.js index 558bd20..3436a23 100644 --- a/bowwowcare/src/utils/Calculator.js +++ b/bowwowcare/src/utils/Calculator.js @@ -8,13 +8,13 @@ export const getAge = (date) => { return age; }; -export const getBwDate = (date) => { +export const getDurationDate = (date) => { const now = new Date(); - const stDate = new Date(date.getFullYear(), date.getMonth() + 1, date.getDate()); + const startDate = new Date(date.getFullYear(), date.getMonth() + 1, date.getDate()); const endDate = new Date(now.getFullYear(), now.getMonth() + 1, now.getDate()); - const btMs = endDate.getTime() - stDate.getTime() ; - const btDay = btMs / (1000*60*60*24); + const ms = endDate.getTime() - startDate.getTime() ; + const durationDate = ms / (1000*60*60*24); - return btDay; + return durationDate; } \ No newline at end of file diff --git a/bowwowcare/src/views/HomePage/HomePage.js b/bowwowcare/src/views/HomePage/HomePage.js index 645f2c6..922ec9e 100644 --- a/bowwowcare/src/views/HomePage/HomePage.js +++ b/bowwowcare/src/views/HomePage/HomePage.js @@ -99,7 +99,7 @@ function HomePage() { onClick={() => navigate("/camera")}>사진 찍기 - {pet && } + {pet && }