diff --git a/README.md b/README.md index 784cb9c..616cd44 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,31 @@
Verta extend class PHP Datetime and Jalali, compatible with Carbon Package.
-change jalali to gregorian and reverse
+## Usage +use verta datetime jalali
+ +```php +echo verta(); //1401-05-24 00:00:00 +``` + +### Gregorian to Jalali +change gregorian to jalali and reverse
```php echo verta('2022-08-15'); //1401-05-24 00:00:00 -echo Verta::parse('1395-10-07 14:12:32') +``` + +### jalali to Gregorian +change jalali to gregorian and reverse
+ +```php +echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00 +``` + +### Carbon to Jalali +change carbon to jalali and reverse
+ +```php +echo now()->toJalali(); //1401-05-24 00:00:00 +``` + +### Jalali to Carbon +change jalali to gregorian and reverse
+ +```php +echo verta()->toCarbon(); //2022-08-15 00:00:00 ```calculate diff two jalali datetime
```php @@ -107,6 +158,11 @@ echo verta('+2 day')->gte('2022-08-15'); 'birthday' => ['required', 'jdate_before_equal'] ... ``` +## Licence -This package has been created by Nasser Hekmati under the license of MIT.
+This package has been created by Nasser Hekmati under the license of MIT. +## Contributors +Thanks to people who contributed for grow varta. + +