The Verta is package for change solar calendar and gregorian together and provide helper function to use date and time.
Verta extend class PHP Datetime and Jalali, compatible with Carbon Package.
## Quick view - [Installation](#installation) - [Usage](#usage) - [Jalali to Gregorian](#jalali-to-gregorian) - [Gregorian to Jalali](#gregorian-to-jalali) - [Jalali to Carbon](#jalali-to-carbon) - [Carbon to Jalali](#carbon-to-jalali) - [Getters](#getters) - [Setters](#setters) - [Fluent Setters](#fluent-setters) - [Formatting](#formatting) - [Common Formats](#common-formats) - [Modification](#modification) - [Boundaries](#boundaries) - [Compression](#compression) - [Difference](#difference) - [Difference for Humans](#difference-for-humans) - [Validation](#validation) - [Localization](#localization) - [Validation Request](#validation-request) - [Licence](#licence) - [Contributors](#contributors) ## Installations ```shell composer require hekmatinasser/verta ```| Laravel Version | Package Version |
|---|---|
| 8.0 | 8.x |
| 9.0 | 8.x |
use verta datetime jalali
```php echo verta(); //1401-05-24 00:00:00 ``` ### Gregorian to Jalalichange gregorian to jalali and reverse
```php echo verta('2022-08-15'); //1401-05-24 00:00:00 ``` ### jalali to Gregorianchange jalali to gregorian and reverse
```php echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00 ``` ### Carbon to Jalalichange carbon to jalali and reverse
```php echo now()->toJalali(); //1401-05-24 00:00:00 ``` ### Jalali to Carbonchange jalali to gregorian and reverse
```php echo verta()->toCarbon(); //2022-08-15 00:00:00 ```access part of jalali datetime
```php $v = verta(); // 1396-03-14 14:18:23 echo $v->year; // 1396 ... ```show datetime variant datetime
```php echo verta('-13 month')->formatDifference(); // 1 سال قبل echo verta()->formatWord('l dS F'); // دوشنبه بیست و چهارم مرداد ... ```manipulate jalali datetime
```php echo verta()->addWeeks(3); ... ```get boundary jalali datetime
```php echo verta()->startWeek(3); ... ```calculate diff two jalali datetime
```php echo verta('+13 day')->diffMonths('2022-08-15'); ... ```get boundary jalali datetime
```php echo verta('+2 day')->gte('2022-08-15'); ... ```validation input form
```php 'birthday' => ['required', 'jdate_before_equal'] ... ``` ## Licence This package has been created by Nasser Hekmati under the license of MIT. ## Contributors Thanks to people who contributed for grow varta.