Skip to content

Commit

Permalink
[fe] chore: 게시글의 기본 조회 단위를 1년으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Denia-park committed Mar 22, 2024
1 parent e105c10 commit 0650cd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions my-garden-fe/src/components/dailyRoutine/api/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions my-garden-fe/src/pages/boards/learn/LearnBoardList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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: "",
Expand Down
4 changes: 2 additions & 2 deletions my-garden-fe/src/pages/boards/notice/NoticeBoardList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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: "",
Expand Down

0 comments on commit 0650cd0

Please sign in to comment.