diff --git a/src/PersianValidators.php b/src/PersianValidators.php index 1b3e3d7..19bcc42 100644 --- a/src/PersianValidators.php +++ b/src/PersianValidators.php @@ -93,7 +93,7 @@ public function validateShamsiDate($attribute, $value, $parameters) $value = $this->faToEnNumbers($value); } - $jdate = explode('/', $value); + $jdate = preg_split('/(\-|\/)/', $value); return (count($jdate) === 3 && $this->isValidjDate($jdate[0], $jdate[1], $jdate[2])); } @@ -115,7 +115,7 @@ public function validateShamsiDateBetween($attribute, $value, $parameters) $value = $this->faToEnNumbers($value); } - $jdate = explode('/', $value); + $jdate = preg_split('/(\-|\/)/', $value); return $this->validateShamsiDate($attribute, $value, $parameters) && ($parameters[0] <= $jdate[0] && $parameters[1] >= $jdate[0]); }