From 639b1dcac78b0687e15285c39fbc3256debe990f Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 16 Oct 2019 02:32:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=B0=EA=B0=90=20=EC=B6=9C=EB=A0=A5=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_history.php | 30 ++++++++++++------------------ hwe/js/history.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 hwe/js/history.js diff --git a/hwe/a_history.php b/hwe/a_history.php index 7ca6d30d..41813ea4 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -101,12 +101,19 @@ if ($month <= 0) { - + - + @@ -116,22 +123,9 @@ if ($month <= 0) {
년월 선택 : - + + diff --git a/hwe/js/history.js b/hwe/js/history.js new file mode 100644 index 00000000..6f1b6799 --- /dev/null +++ b/hwe/js/history.js @@ -0,0 +1,31 @@ +jQuery(function($){ + + +var currYear = startYear; +var currMonth = startMonth; + +var $yearMonth = $('#yearmonth'); +var $elements = $(); + +var endDate = lastYear * 12 + lastMonth - 1; +var currDate = startYear * 12 + startMonth - 1; +while(currDate <= endDate){ + + var target = currYear*100 + currMonth; + var sel = ''; + if(currYear == selectYear && currMonth == selectMonth){ + sel = 'selected="selected"'; + } + var option = $(''.format(target, sel, currYear, currMonth)); + $elements = $elements.add(option); + + currMonth += 1; + if(currMonth > 12){ + currYear += 1; + currMonth -= 12; + } + currDate += 1; +} +$yearMonth.empty(); +$yearMonth.append($elements); +}); \ No newline at end of file