fix: 연감 표기를 staticValues export에 따라 수정
This commit is contained in:
+11
-9
@@ -109,17 +109,19 @@ $nations = $history['nations'];
|
|||||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||||
<?= WebUtil::printCSS('css/map.css') ?>
|
<?= WebUtil::printCSS('css/map.css') ?>
|
||||||
<?= WebUtil::printCSS('css/history.css') ?>
|
<?= WebUtil::printCSS('css/history.css') ?>
|
||||||
|
<?= WebUtil::printStaticValues([
|
||||||
|
'staticValues' => [
|
||||||
|
'startYear' => $s_year,
|
||||||
|
'startMonth' => $s_month,
|
||||||
|
'lastYear' => $e_year,
|
||||||
|
'lastMonth' => $e_month,
|
||||||
|
'selectYear' => $year,
|
||||||
|
'selectMonth' => $month,
|
||||||
|
'nations' => $nations ? JSON::encode($history['nations']) : '{}'
|
||||||
|
]
|
||||||
|
])?>
|
||||||
<?= WebUtil::printDist('ts', ['common', 'history']) ?>
|
<?= WebUtil::printDist('ts', ['common', 'history']) ?>
|
||||||
|
|
||||||
<script>
|
|
||||||
var startYear = <?= $s_year ?>;
|
|
||||||
var startMonth = <?= $s_month ?>;
|
|
||||||
var lastYear = <?= $e_year ?>;
|
|
||||||
var lastMonth = <?= $e_month ?>;
|
|
||||||
var selectYear = <?= $year ?>;
|
|
||||||
var selectMonth = <?= $month ?>;
|
|
||||||
var nations = <?= $nations ? JSON::encode($history['nations']) : '{}' ?>;
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+15
-11
@@ -3,25 +3,29 @@ import '@/map';
|
|||||||
import { joinYearMonth } from './util/joinYearMonth';
|
import { joinYearMonth } from './util/joinYearMonth';
|
||||||
import { parseYearMonth } from './util/parseYearMonth';
|
import { parseYearMonth } from './util/parseYearMonth';
|
||||||
|
|
||||||
declare const startYear:number;
|
declare const staticValues: {
|
||||||
declare const startMonth:number;
|
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 ($) {
|
$(function ($) {
|
||||||
let currYear = startYear;
|
let currYear = staticValues.startYear;
|
||||||
let currMonth = startMonth;
|
let currMonth = staticValues.startMonth;
|
||||||
const selectDate = joinYearMonth(selectYear, selectMonth);
|
const selectDate = joinYearMonth(staticValues.selectYear, staticValues.selectMonth);
|
||||||
|
|
||||||
const $yearMonth = $('#yearmonth');
|
const $yearMonth = $('#yearmonth');
|
||||||
let $elements = $();
|
let $elements = $();
|
||||||
|
|
||||||
const endDate = joinYearMonth(lastYear, lastMonth) + 1;//연감 마지막 + 1(현재)
|
const endDate = joinYearMonth(staticValues.lastYear, staticValues.lastMonth) + 1;//연감 마지막 + 1(현재)
|
||||||
let currDate = joinYearMonth(startYear, startMonth);
|
let currDate = joinYearMonth(staticValues.startYear, staticValues.startMonth);
|
||||||
while (currDate <= endDate) {
|
while (currDate <= endDate) {
|
||||||
let sel = '';
|
let sel = '';
|
||||||
if (currDate == selectDate) {
|
if (currDate == selectDate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user