From 343c4cb95a8e20e71eb9eaa8ecc8b3c3ecf74ed0 Mon Sep 17 00:00:00 2001 From: chanthornAcademy Date: Wed, 27 Sep 2023 09:51:34 +0700 Subject: [PATCH] fixed bugs --- src/ToKhmerDate.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ToKhmerDate.php b/src/ToKhmerDate.php index 8976cfa..cba1eb3 100644 --- a/src/ToKhmerDate.php +++ b/src/ToKhmerDate.php @@ -79,15 +79,14 @@ public static function format(string $format = ''): string 'b' => function () use ($beYear) { return $beYear; }, - 'c' => function () use ($beYear) { - return $beYear; + 'c' => function () { + return self::$date->year; }, 'j' => function () use ($lunar) { return $lunar['years']['JE']; }, ]; $result = preg_replace_callback('/[a-zA-Z]/', function ($matches) use ($formatRules) { - // fix Undefined array key if (!isset($formatRules[$matches[0]])) { return $matches[0];