Skip to content

Commit cc916f2

Browse files
committed
add character param for ValidJalaliDate
1 parent 672d9c3 commit cc916f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Rules/ValidJalaliDate.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
class ValidJalaliDate implements Rule
88
{
9+
public function __construct(
10+
public string $character = '/',
11+
) {}
12+
913
/**
1014
* Check jalali date is valid.
1115
*
@@ -19,7 +23,7 @@ public function passes($attribute, $value)
1923
return false;
2024
}
2125

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

2428
return $this->checkValidDate(...$date);
2529
}

0 commit comments

Comments
 (0)