Skip to content

Commit

Permalink
Update Flatpickr.php
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanus-tantiono authored Oct 27, 2023
1 parent c1a7487 commit f6a69bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Forms/Components/Flatpickr.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Filament\Forms\Components\Contracts;
use Filament\Forms\Components\Field;
use Filament\Support\Concerns\HasExtraAlpineAttributes;
use Closure;

class Flatpickr extends Field implements Contracts\CanBeLengthConstrained, Contracts\HasAffixActions
{
Expand Down Expand Up @@ -85,9 +86,9 @@ class Flatpickr extends Field implements Contracts\CanBeLengthConstrained, Contr

protected bool $inline = false;

protected Carbon|string|null $maxDate = null;
protected Carbon|string|null|Closure $maxDate = null;

protected Carbon|string|null $minDate = null;
protected Carbon|string|null|Closure $minDate = null;

protected ?string $maxTime = null;

Expand Down Expand Up @@ -477,7 +478,7 @@ public function getMaxDate(): Carbon|string|null
return $this->maxDate;
}

public function maxDate(Carbon|string|null $maxDate = 'now'): static
public function maxDate(Carbon|string|null|Closure $maxDate = 'now'): static
{
$this->maxDate = $maxDate ? Carbon::parse($maxDate) : $maxDate;

Expand All @@ -489,7 +490,7 @@ public function getMinDate(): Carbon|string|null
return $this->minDate;
}

public function minDate(Carbon|string|null $minDate): static
public function minDate(Carbon|string|null $minDate|Closure): static
{
$this->minDate = $minDate ? Carbon::parse($minDate) : $minDate;

Expand Down

0 comments on commit f6a69bb

Please sign in to comment.