From 45203a671799b2678c9cbebbeef01bc0e937673f Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 23 Mar 2022 23:45:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=97=B0=EA=B0=90=20=ED=91=9C=EA=B8=B0?= =?UTF-8?q?=EB=A5=BC=20staticValues=20export=EC=97=90=20=EB=94=B0=EB=9D=BC?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_history.php | 20 +++++++++++--------- hwe/ts/history.ts | 26 +++++++++++++++----------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/hwe/a_history.php b/hwe/a_history.php index 94473d95..5932b08d 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -109,17 +109,19 @@ $nations = $history['nations']; + [ + 'startYear' => $s_year, + 'startMonth' => $s_month, + 'lastYear' => $e_year, + 'lastMonth' => $e_month, + 'selectYear' => $year, + 'selectMonth' => $month, + 'nations' => $nations ? JSON::encode($history['nations']) : '{}' + ] + ])?> - diff --git a/hwe/ts/history.ts b/hwe/ts/history.ts index 5ec050dd..52d9b527 100644 --- a/hwe/ts/history.ts +++ b/hwe/ts/history.ts @@ -3,25 +3,29 @@ import '@/map'; import { joinYearMonth } from './util/joinYearMonth'; import { parseYearMonth } from './util/parseYearMonth'; -declare const startYear:number; -declare const startMonth:number; +declare const staticValues: { + startYear:number; + startMonth:number; + + lastYear: number; + lastMonth: number; + + selectYear: number; + selectMonth: number; +} -declare const lastYear: number; -declare const lastMonth: number; -declare const selectYear: number; -declare const selectMonth: number; $(function ($) { - let currYear = startYear; - let currMonth = startMonth; - const selectDate = joinYearMonth(selectYear, selectMonth); + let currYear = staticValues.startYear; + let currMonth = staticValues.startMonth; + const selectDate = joinYearMonth(staticValues.selectYear, staticValues.selectMonth); const $yearMonth = $('#yearmonth'); let $elements = $(); - const endDate = joinYearMonth(lastYear, lastMonth) + 1;//연감 마지막 + 1(현재) - let currDate = joinYearMonth(startYear, startMonth); + const endDate = joinYearMonth(staticValues.lastYear, staticValues.lastMonth) + 1;//연감 마지막 + 1(현재) + let currDate = joinYearMonth(staticValues.startYear, staticValues.startMonth); while (currDate <= endDate) { let sel = ''; if (currDate == selectDate) {