F
Filament10mo ago
Roberto

DateField to 10 secs ago format

Hello there, i have a dateTime field in filament table. i want to show it in format as "10 secs ago" and it should also increment as the time pass by. i know i need some javascript & think i need some custom component or something should i create make:form-field for this? what is the best way?
No description
Solution:
As for the formatting, you could go source-diving into the Table TextColumn ->since() method to customize it further. https://filamentphp.com/docs/3.x/tables/columns/text#date-formatting...
Jump to solution
4 Replies
Solution
DrByte
DrByte10mo ago
As for the formatting, you could go source-diving into the Table TextColumn ->since() method to customize it further. https://filamentphp.com/docs/3.x/tables/columns/text#date-formatting
Roberto
Roberto10mo ago
thank you that solved one of my problem
DrByte
DrByte10mo ago
The panel dashboard widgets refresh automatically. You could explore how/when they do that for your update question. But actually if you're not pulling new record data with a poll refresh, then you'll need to let the browser know the actual timestamp and let javascript update the "since" display independent of the server.
Roberto
Roberto10mo ago
i'm going to poll for new records So, it is going to adjust itself when new records comes in?