Skip to content

Commit

Permalink
Rename weekStartsOn to firstDayOfWeek
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Oct 19, 2023
1 parent 653cb21 commit ec82093
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,13 @@ The `characterLimit` method has been renamed to `maxLength`.
+Textarea::make('Description')->maxLength(100)
```

The `weekStartsOn` method has been renamed to `firstDayOfWeek`.

```diff
-DatePicker::make('Date')->weekStartsOn(1)
+DatePicker::make('Date')->firstDayOfWeek(1)
```

The `CharacterLimit` trait has been renamed to `MaxLength`.

```diff
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Settings/WeekDay.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

trait WeekDay
{
public function weekStartsOn(int $day): static
public function firstDayOfWeek(int $day): static
{
$this->settings['first_day'] = $day;

Expand Down
4 changes: 2 additions & 2 deletions tests/Fields/DatePickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function testReturnFormat()
$this->assertSame('d/m/Y', $field['return_format']);
}

public function testWeekStartsOnn()
public function testFirstDayOfWeek()
{
$field = DatePicker::make('Date Week Day')->weekStartsOn(1)->get();
$field = DatePicker::make('Date Week Day')->firstDayOfWeek(1)->get();
$this->assertSame(1, $field['first_day']);
}
}

0 comments on commit ec82093

Please sign in to comment.