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']); } /**