Skip to content
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

[Bug]: ActivityDate is not formatted #34

Open
bookoly opened this issue Nov 19, 2024 · 2 comments
Open

[Bug]: ActivityDate is not formatted #34

bookoly opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@bookoly
Copy link

bookoly commented Nov 19, 2024

What happened?

I use this package with spatie activity log. When trying to format the date, nothing happens. I'm using the default created_at column from activity_log table.

How to reproduce the bug

Simply use ActivityDate inside InfoBuilder:

ActivityDate::make('created_at')->date('F j, Y'),

Package Version

1.2.9

PHP Version

8.2

Laravel Version

11.32.0

Which operating systems does with happen with?

macOS

Notes

No response

@bookoly bookoly added the bug Something isn't working label Nov 19, 2024
@ezalorpro
Copy link

Looks like the getDate function was removed in this commit

image

@bookoly
Copy link
Author

bookoly commented Dec 7, 2024

@ezalorpro Thank you for the hint. This fixed it for me:

ActivityDate::make('created_at')->modifyState(fn (Carbon $state) => str($state->format('d.m.Y H:i:s'))->toHtmlString()),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants