add multiple jalali date format validator
This commit is contained in:
1 parent
775dcc4198
commit
401296da38
1 file changed
+17
@@ -30,6 +30,23 @@ class JalaliValidator
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if an input is a valid Jalali date with the specified format
|
||||||
|
* @param string $attribute
|
||||||
|
* @param string $value
|
||||||
|
* @param array $parameters
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function validateDateMulti(string $attribute, string $value, array $parameters): bool
|
||||||
|
{
|
||||||
|
foreach ($parameters as $format) {
|
||||||
|
if ($this->validateDate($attribute, $value, $format)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if an input is a valid Jalali date with the specified format and
|
* Determines if an input is a valid Jalali date with the specified format and
|
||||||
* it is equal a given date
|
* it is equal a given date
|
||||||
|
|||||||
Reference in new issue
Block a user