From 553b5e64b62c55dc9706d4ae12217d1af89e9dd8 Mon Sep 17 00:00:00 2001 From: kawase Date: Tue, 24 Dec 2024 12:24:34 +0900 Subject: [PATCH] =?UTF-8?q?=E5=B9=B4=E5=8F=B7=E3=81=AE=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=82=92=E5=89=8D=E3=82=BC=E3=83=AD=E3=81=82=E3=82=8A=E3=81=AB?= =?UTF-8?q?=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Baser/View/Helper/BcFormHelper.php | 1 + lib/Baser/View/Helper/BcTextHelper.php | 2 +- lib/Baser/View/Helper/BcTimeHelper.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Baser/View/Helper/BcFormHelper.php b/lib/Baser/View/Helper/BcFormHelper.php index fca7ff1b27..996b02e94f 100644 --- a/lib/Baser/View/Helper/BcFormHelper.php +++ b/lib/Baser/View/Helper/BcFormHelper.php @@ -1422,6 +1422,7 @@ protected function _generateOptions($name, $options = []) if ($wyears) { foreach($wyears as $value) { list($w, $year) = explode('-', $value); + $year = sprintf('%02d', $year); $data[$value] = $this->BcTime->nengo($w) . ' ' . $year; } } diff --git a/lib/Baser/View/Helper/BcTextHelper.php b/lib/Baser/View/Helper/BcTextHelper.php index 12dd9ed8a3..7061091d08 100755 --- a/lib/Baser/View/Helper/BcTextHelper.php +++ b/lib/Baser/View/Helper/BcTextHelper.php @@ -255,7 +255,7 @@ public function dateTimeWareki($arrDate) } list($w, $year) = explode('-', $arrDate['year']); $wareki = $this->BcTime->nengo($w); - return $wareki . " " . $year . "年 " . $arrDate['month'] . "月 " . $arrDate['day'] . '日'; + return $wareki . " " . sprintf('%02d', $year) . "年 " . $arrDate['month'] . "月 " . $arrDate['day'] . '日'; } /** diff --git a/lib/Baser/View/Helper/BcTimeHelper.php b/lib/Baser/View/Helper/BcTimeHelper.php index f41b168e54..232670ffef 100755 --- a/lib/Baser/View/Helper/BcTimeHelper.php +++ b/lib/Baser/View/Helper/BcTimeHelper.php @@ -83,7 +83,7 @@ public function wyear($date) if (!preg_match($this->warekiRegex, $date, $matches)) { return false; } - return $matches['year']; + return sprintf('%02d', $matches['year']); } /**