jalali
jalali copied to clipboard
Assert\InvalidArgumentException: Provided "30" is neither greater than or equal to "1" nor less than or equal to "29".
Hi
Apparently, there are problems in calculating the past time
- Package Version: 3.4
Code:
use Morilog\Jalali\Jalalian;
$date = Jalalian::fromDateTime('2009-03-20 00:00:00');
$result = $date->subYears(1);
// or
(new Jalalian(1387, 12, 30))->subYears(1);
Result:
Its because of your input, ESFAND at 1387 has not 30 days
Its because of your input, ESFAND at 1387 has not 30 days
OK, so 365 days before should be calculated It should not give an error