asorasoft / chhankitek
Convert from AD (Anno Domini) to Lunar (Chhankitek) format.
Installs: 1 831
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 8
Open Issues: 0
Requires
- php: >=7.2
- illuminate/support: >=4.2
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-05 08:52:25 UTC
README
Convert from AD (Anno Domini) to Lunar (Chhankitek) format see more.
Installation
You can install the package via composer:
composer require asorasoft/chhankitek
Usage
// In Laravel controller, use this trait use HasChhankitek; // start call chhankitek method $toLunarDate = $this->chhankiteck(Carbon::now()); $toLunarDate->toString(); // ថ្ងៃច័ន្ទ ៤ រោច ខែបឋមាសាឍ ឆ្នាំឆ្លូវ ត្រីស័ក ពុទ្ធសករាជ ២៥៦៥
Available methods
// In Laravel controller, use this trait use HasChhankitek; $toLunarDate = $this->chhankiteck(Carbon::now()); $toLunarDate->getDayOfWeek(); // អាទិត្យ, ច័ន្ទ... $toLunarDate->getLunarDay(); // ១កើត, ២កើត... $toLunarDate->getLunarMonth(); // ចេត្រ... $toLunarDate->getLunarZodiac(); // ជូត, ឆ្លូវ... $toLunarDate->getLunarEra(); // ត្រីស័ក... $toLunarDate->getLunarYear(); // ២៥៦៥, ២៥៦៦..
Or we can use toLunarDate
helper function.
toLunarDate(Carbon::now())->toString(); // ថ្ងៃច័ន្ទ ៤ រោច ខែបឋមាសាឍ ឆ្នាំឆ្លូវ ត្រីស័ក ពុទ្ធសករាជ ២៥៦៥
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mabhelitc@gmail.com instead of using the issue tracker.
Support
If you like this package and want to support me, you can buy me a coffee ☕
Credits
License
The MIT License (MIT). Please see License File for more information.
Authors and acknowledgment
This library might not exist without hardwork of these people:
- Base on algorithm of
Mr.Phylypo Tum
from Cam-CC - Porting from momentkh by
ThyrithSor
intoJava
- Khmer New Year Time Calculation
- Porting from MetheaX/khmer-chhankitek-calendar by
MetheaX
intoLaravel Package