activity-timeline icon indicating copy to clipboard operation
activity-timeline copied to clipboard

[Bug]: ActivityDate is not formatted

Open bookoly opened this issue 1 year ago • 3 comments

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 avatar Nov 19 '24 13:11 bookoly

Looks like the getDate function was removed in this commit

image

ezalorpro avatar Nov 24 '24 16:11 ezalorpro

@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()),

bookoly avatar Dec 07 '24 12:12 bookoly

This may be related.

albertobenavides avatar Mar 03 '25 21:03 albertobenavides