-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added zipcode and birthdate to event signup export (issue #300) #396
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,8 +131,10 @@ | |
"street", | ||
"houseNumber", | ||
"city", | ||
"zipcode", | ||
"email", | ||
"phonenumber", | ||
"birthDay", | ||
); | ||
$selectedElements = array_merge($selectedElements, $users["customfields"]); | ||
|
||
|
@@ -142,6 +144,10 @@ | |
foreach ($selectedElements as $element) { | ||
$userline[$element] = $user[$element]; | ||
} | ||
|
||
//format birthday to not include the time of day | ||
$userline["birthDay"] = substr($userline["birthDay"], 0, 10); | ||
Comment on lines
+148
to
+149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest performing this attribute formatting in the protected $casts = [
'birthDay' => 'date',
]; This will ensure the Then, I'd suggest defining an accessor to retrieve the "formatted birthday", as follows. public function birthdayFormatted(): Attribute
{
return Attribute::make(
get: fn () => $this->birthDay->format('Y-m-d'),
);
} Note that the formatted birthday value can now simply be retrieved using |
||
|
||
array_push($activeUsers, $userline); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, this would need to be changed to the
birthdayFormatted
property instead.