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.
This package has been created by Nasser Hekmati under the license of MIT.
- Installation
- Usage
- Getters
- Setters
- Formatting
- Modification
- Boundaries
- Compression
- Validation
- Localization
- Validation Request
- Licence
- Contributors
composer require hekmatinasser/verta| Laravel Version | Package Version |
|---|---|
| 8.0 | 8.0 |
| 9.0 | 8.2 |
| 10.0 | 8.3 |
| 11.0 | 8.4 |
| 12.0 | 8.5 |
use verta datetime jalali
echoverta(); //1401-05-24 00:00:00change gregorian to jalali and reverse
echoverta('2022-08-15'); //1401-05-24 00:00:00change jalali to gregorian and reverse
echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00change carbon to jalali and reverse
echonow()->toJalali(); //1401-05-24 00:00:00change jalali to gregorian and reverse
echoverta()->toCarbon(); //2022-08-15 00:00:00access part of jalali datetime
$v = verta(); // 1396-03-14 14:18:23echo$v->year; // 1396set part of jalali datetime
$v = verta(); // 1396-03-14 14:18:23echo$v->year = 1395;set multiple part of jalali datetime
$v = verta(); // 1396-03-14 14:18:23echo$v->setTimeString('12:25:45');show datetime variant datetime
echoverta()->format('Y.m.d'); // 1401.05.24echoverta()->formatWord('l dS F'); // دوشنبه بیست و چهارم مردادshow common datetime variant datetime
echoverta()->formatJalaliDatetime(); // output 1395/10/07 14:12:25show difference format readable humans
echoverta('-13 month')->formatDifference(); // 1 سال قبلmanipulate jalali datetime
echoverta()->addWeeks(3); ...get boundary jalali datetime
echoverta()->startWeek(3); get compression jalali datetime
echoverta('+2 day')->gte('2022-08-15');calculate difference two jalali datetime
echoverta('+13 day')->diffMonths('2022-08-15'); check datetime check is valid
echo Verta::isLeapYear(1394); // falseset language for formatting datetime
Verta::setLocale('ar');validation input form
'birthday' => ['required', 'jdate_before_equal']This package has been created by Nasser Hekmati under the license of MIT.
Thanks to people who contributed for grow verta.
