Skip to content

Commit

Permalink
🔨 fix: toFormattedNepaliDate to use config values and remove required…
Browse files Browse the repository at this point in the history
… arguments.
  • Loading branch information
anuzpandey committed Aug 31, 2024
1 parent 3b24ca2 commit 7bc90ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Traits/NepaliDateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ public function toNepaliDate(?string $format = null, ?string $locale = null): st
{
$this->performCalculationOnEnglishDate();

return $this->toFormattedNepaliDate(
$format ?? config('nepali-date.default_format'),
$locale ?? config('nepali-date.default_locale'),
);
return $this->toFormattedNepaliDate($format, $locale);
}

public function toFormattedNepaliDate(string $format, string $locale): string
public function toFormattedNepaliDate(?string $format = null, ?string $locale = null): string
{
$format = $format ?? config('nepali-date.default_format');
$locale = $locale ?? config('nepali-date.default_locale');

$nepaliDateArray = $this->toNepaliDateArrayData();

return $this->formatDateString($format, $locale, $nepaliDateArray);
Expand Down

0 comments on commit 7bc90ca

Please sign in to comment.