Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chanthornsp committed Aug 31, 2023
1 parent f82b910 commit be32ed9
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
# Khmer Lunar Date with Carbon

# Installation

```bash
composer require chanthorn/carbon-kh
```

# Usage

```php
require_once __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
$date = Carbon::parse('2023-01-01');
$khmerDate = new ToKhmerDate($date);
echo $khmerDate->format();
use Chanthorn\CarbonKh\ToKhmerDate;

$date = Carbon::parse('2023-01-01');
$khmerDate = new ToKhmerDate($date);

echo $khmerDate::format(); // ថ្ងៃអាទិត្យ ១០កើត ខែបុស្ស ឆ្នាំខាល ចត្វាស័ក ពុទ្ធសករាជ ២៥៦៦
echo $khmerDate::format('dN ថ្ងៃW ខែm ព.ស. b'); // ១០កើត ថ្ងៃអាទិត្យ ខែបុស្ស ព.ស. ២៥៦៦

print_r($khmerDate::khNewYear());
// array:3 [
// "date" => Carbon\Carbon
// "days" => 3
// "dates" => array:3
// ]

```

# Author
## Format

Check out format [here](https://github.com/ThyrithSor/momentkh#format)

# Authors

- This library is Ported from [khmercal](https://github.com/seanghay/khmercal) by [Seanghay](https://github.com/seanghay) and [momentkh](https://github.com/ThyrithSor/momentkh) by [Thyrith Sor](https://github.com/ThyrithSor) in to PHP.

0 comments on commit be32ed9

Please sign in to comment.