File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ require_once __DIR__ . '/../vendor/autoload.php ' ;
3+
4+ use PPhatDev \LunarDate \KhmerDate ;
5+
6+ // ANSI color codes
7+ $ colors = [
8+ 'yellow ' => "\033[33m " ,
9+ 'green ' => "\033[32m " ,
10+ 'cyan ' => "\033[36m " ,
11+ 'magenta ' => "\033[35m " ,
12+ 'reset ' => "\033[0m "
13+ ];
14+
15+ echo "{$ colors ['yellow ' ]}=== Running Current BE Year Calculation === {$ colors ['reset ' ]}\n" ;
16+ $ khmerDate = new KhmerDate ();
17+
18+ echo "{$ colors ['green ' ]}Current BE Year: {$ khmerDate ->khYear ()}{$ colors ['reset ' ]} \n" ;
19+ echo "{$ colors ['cyan ' ]}Current Gregorian Year: {$ khmerDate ->format ('Y ' )}{$ colors ['reset ' ]} \n" ;
20+ echo "{$ colors ['magenta ' ]}Current Khmer Month: {$ khmerDate ->khMonth ()}{$ colors ['reset ' ]} \n" ;
21+ echo "{$ colors ['yellow ' ]}Current Khmer Day: {$ khmerDate ->khDay ()}{$ colors ['reset ' ]} \n" ;
22+ echo "{$ colors ['green ' ]}Current Khmer Date: {$ khmerDate ->format ('d-m-Y ' )}{$ colors ['reset ' ]} \n" ;
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ public static function getNumberOfDayInGregorianYear(int $adYear): int
315315 public static function getBEYear (DateTime $ dateTime ): int
316316 {
317317 $ visakhaBochea = self ::getVisakhaBochea ((int )$ dateTime ->format ('Y ' ));
318- if ($ dateTime >= $ visakhaBochea ) {
318+ if ($ dateTime > $ visakhaBochea ) {
319319 return (int )$ dateTime ->format ('Y ' ) + 544 ;
320320 } else {
321321 return (int )$ dateTime ->format ('Y ' ) + 543 ;
You can’t perform that action at this time.
0 commit comments