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

Date of entry not showing in viewer #354

Open
vascocajada opened this issue Mar 15, 2023 · 0 comments
Open

Date of entry not showing in viewer #354

vascocajada opened this issue Mar 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@vascocajada
Copy link

vascocajada commented Mar 15, 2023

| Date of entry not showing in viewer
| ----------------------------| -----------------------
| auditor-bundle version | 5.2
| PHP version | 7.4
| Database | MariaDB
| Twig | 2.13

Summary

The created at value of the entry doesn't appear in the change log in the viewer. See screenshot:
image

Proposed solution

I have a workaround: I overrode the template Audit\entry.html.twig with a working date filter

// src/templates/DHAuditorBundle/Audit/entry.html.twig

    ...
    <div class="text-right text-sm whitespace-nowrap text-gray-500">
        <time datetime="{{ entry.getCreatedAt()|date('Y-m-d H:i:s') }}">
            <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline align-text-top" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
            </svg>
            {{ entry.getCreatedAt()|format_datetime() }}
        </time>
    </div>
    ...

Inside the bundle we have
{{ entry.getCreatedAt()|format_datetime('full', 'long') }}
But I think that for that to work it needs to be provided a locale too.

I can create pull request if needed.

@vascocajada vascocajada added the bug Something isn't working label Mar 15, 2023
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

1 participant