Skip to content

Commit

Permalink
add character param for ValidJalaliDate
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Jun 2, 2024
1 parent 672d9c3 commit cc916f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Rules/ValidJalaliDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

class ValidJalaliDate implements Rule
{
public function __construct(
public string $character = '/',
) {}

/**
* Check jalali date is valid.
*
Expand All @@ -19,7 +23,7 @@ public function passes($attribute, $value)
return false;
}

$date = explode('/', $value); // TODO: Add contruct for jalali date
$date = explode($this->character, $value);

return $this->checkValidDate(...$date);
}
Expand Down

0 comments on commit cc916f2

Please sign in to comment.