Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chanthornsp committed Sep 27, 2023
1 parent 9eb79f0 commit 343c4cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ToKhmerDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 343c4cb

Please sign in to comment.