We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The problem with
{{ item.createdAt|time_diff }}
is that it renders HTML with the age of the item at the time of rendering.
What we want is the age of the item. This can be done by installing stimulus-timeago, and instead using
<time data-controller="timeago" data-timeago-add-suffix-value="true" data-timeago-include-seconds-value="true" data-timeago-refresh-interval-value="1000" data-timeago-datetime-value="{{ item.createdAt|date('c') }}"></time>.
That way, when it runs offline the time ago is correct. And even updated dynamically!
Add an item at
https://phpwa-demo.survos.com/
Go offline and refresh, the item age is accurate.
The text was updated successfully, but these errors were encountered:
Indeed. It looks better and will perfectly fit in case data are loaded async
Sorry, something went wrong.
No branches or pull requests
The problem with
is that it renders HTML with the age of the item at the time of rendering.
What we want is the age of the item. This can be done by installing stimulus-timeago, and instead using
That way, when it runs offline the time ago is correct. And even updated dynamically!
Add an item at
https://phpwa-demo.survos.com/
Go offline and refresh, the item age is accurate.
The text was updated successfully, but these errors were encountered: