From 0650cd076ff258139b664b127ba3b45ae144817a Mon Sep 17 00:00:00 2001 From: HyunggiPark Date: Sat, 23 Mar 2024 00:06:02 +0900 Subject: [PATCH] =?UTF-8?q?[fe]=20chore:=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=EC=9D=98=20=EA=B8=B0=EB=B3=B8=20=EC=A1=B0=ED=9A=8C=20=EB=8B=A8?= =?UTF-8?q?=EC=9C=84=EB=A5=BC=201=EB=85=84=EC=9C=BC=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my-garden-fe/src/components/dailyRoutine/api/util.js | 8 ++++---- my-garden-fe/src/pages/boards/learn/LearnBoardList.vue | 4 ++-- my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/my-garden-fe/src/components/dailyRoutine/api/util.js b/my-garden-fe/src/components/dailyRoutine/api/util.js index 6eea9649..8ae3a86a 100644 --- a/my-garden-fe/src/components/dailyRoutine/api/util.js +++ b/my-garden-fe/src/components/dailyRoutine/api/util.js @@ -45,14 +45,14 @@ export function convertDateFormat(date) { } /** - * 현재 시간을 기준으로 한 달 전의 일자를 특정 포맷으로 반환한다. + * 현재 시간을 기준으로 1년 전의 일자를 특정 포맷으로 반환한다. * - * @returns {string} 한 달 전의 일자 (yyyy-MM-dd) + * @returns {string} 1년 전의 일자 (yyyy-MM-dd) */ -export function getOneMonthAgoDate() { +export function getOneYearAgoDate() { const currentDate = new Date(); - currentDate.setMonth(currentDate.getMonth() - 1); + currentDate.setFullYear(currentDate.getFullYear() - 1); const year = currentDate.getFullYear(); const month = String(currentDate.getMonth() + 1).padStart(2, '0'); diff --git a/my-garden-fe/src/pages/boards/learn/LearnBoardList.vue b/my-garden-fe/src/pages/boards/learn/LearnBoardList.vue index 15d10c31..9af4ebd3 100644 --- a/my-garden-fe/src/pages/boards/learn/LearnBoardList.vue +++ b/my-garden-fe/src/pages/boards/learn/LearnBoardList.vue @@ -4,7 +4,7 @@ import TableContents from "@/components/boards/common/TableContents.vue"; import {onMounted, ref, watch} from "vue"; import {getLearnBoardCategoryApi, getLearnBoardListApi} from "@/components/boards/learn/api/api.js"; -import {getOneMonthAgoDate, getTodayDate} from "@/components/dailyRoutine/api/util.js"; +import {getOneYearAgoDate, getTodayDate} from "@/components/dailyRoutine/api/util.js"; import SearchForm from "@/components/boards/common/SearchForm.vue"; import {router} from "@/scripts/router.js"; import {useRoute} from "vue-router"; @@ -19,7 +19,7 @@ const learnPage = ref({}); const learnTotalCount = ref(0); const categories = ref([]); const queryParameter = ref({ - startDate: getOneMonthAgoDate(), + startDate: getOneYearAgoDate(), endDate: getTodayDate(), category: "", searchText: "", diff --git a/my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue b/my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue index 45cc25b5..340d6bdb 100644 --- a/my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue +++ b/my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue @@ -8,7 +8,7 @@ import { getNoticeBoardListApi, getNoticeImportantBoardListApi } from "@/components/boards/notice/api/api.js"; -import {getOneMonthAgoDate, getTodayDate} from "@/components/dailyRoutine/api/util.js"; +import {getOneYearAgoDate, getTodayDate} from "@/components/dailyRoutine/api/util.js"; import SearchForm from "@/components/boards/common/SearchForm.vue"; import {router} from "@/scripts/router.js"; import {useRoute} from "vue-router"; @@ -24,7 +24,7 @@ const noticeImportantPage = ref([]); const noticeTotalCount = ref(0); const categories = ref([]); const queryParameter = ref({ - startDate: getOneMonthAgoDate(), + startDate: getOneYearAgoDate(), endDate: getTodayDate(), category: "", searchText: "",