Skip to content

Commit 357f263

Browse files
committed
Corrected display Birthday
1 parent 31c1706 commit 357f263

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/Livewire/People/Add/Partner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function mount(): void
6565
->map(function ($p) {
6666
return [
6767
'id' => $p->id,
68-
'name' => $p->name . ' [' . (($p->sex === 'm') ? __('app.male') : __('app.female')) . '] (' . $p->birth_formatted . ')',
68+
'name' => $p->name . ' [' . (($p->sex === 'm') ? __('app.male') : __('app.female')) . '] ' . ($p->birth_formatted ? '(' . $p->birth_formatted . ')' : ''),
6969
];
7070
});
7171
}

app/Livewire/People/Edit/Family.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public function mount(): void
4444
$this->fathers = $persons->where('sex', 'm')->map(function ($p) {
4545
return [
4646
'id' => $p->id,
47-
'name' => $p->name . ' (' . $p->birth_formatted . ')',
47+
'name' => $p->name . ($p->birth_formatted ? '(' . $p->birth_formatted . ')' : ''),
4848
];
4949
})->values();
5050

5151
$this->mothers = $persons->where('sex', 'f')->map(function ($p) {
5252
return [
5353
'id' => $p->id,
54-
'name' => $p->name . ' (' . $p->birth_formatted . ')',
54+
'name' => $p->name . ($p->birth_formatted ? '(' . $p->birth_formatted . ')' : ''),
5555
];
5656
})->values();
5757

@@ -62,7 +62,7 @@ public function mount(): void
6262
->map(function ($couple) {
6363
return [
6464
'id' => $couple->id,
65-
'couple' => $couple->name . (($couple->date_start) ? ' (' . $couple->date_start_formatted . ')' : ''),
65+
'couple' => $couple->name . ($couple->date_start) ? ' (' . $couple->date_start_formatted . ')' : '',
6666
];
6767
})->values();
6868
}

app/Livewire/People/Edit/Partner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function mount(): void
4444
->map(function ($p) {
4545
return [
4646
'id' => $p->id,
47-
'name' => $p->name . ' [' . (($p->sex === 'm') ? __('app.male') : __('app.female')) . '] (' . $p->birth_formatted . ')',
47+
'name' => $p->name . ' [' . (($p->sex === 'm') ? __('app.male') : __('app.female')) . '] ' . ($p->birth_formatted ? '(' . $p->birth_formatted . ')' : ''),
4848
];
4949
});
5050
}

0 commit comments

Comments
 (0)