Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Fix clashing date filter call #591

Merged
merged 1 commit into from
May 2, 2020
Merged

Conversation

core23
Copy link
Member

@core23 core23 commented May 1, 2020

Subject

There is a problem when calling format_datetime when you use SonataIntlBundle and TwigIntlBundle. Both bundles provide a format_datetime filter with a different signature.

I am targeting this branch, because this is a bugfix.

Changelog

### Fixed
- Fix clashing `format_datetime` filter call

@core23 core23 added the patch label May 1, 2020
@core23 core23 requested a review from a team May 1, 2020 09:48
@@ -19,7 +19,7 @@
<title>{{ post.title }}</title>
<link>{{ url('sonata_news_view', { 'permalink': sonata_news_permalink(post) }, true) }}</link>
<description><![CDATA[ {{ post.abstract }} ]]></description>
<pubDate>{{ post.publicationDateStart | format_datetime('eee, MM LLL yyyy HH:mm:ss ZZZ', 'en')}}</pubDate>
<pubDate>{{ post.publicationDateStart | date('Y-m-d\\TH:i:sP', 'UTC') }}</pubDate>
Copy link
Member

@phansys phansys May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<pubDate>{{ post.publicationDateStart | date('Y-m-d\\TH:i:sP', 'UTC') }}</pubDate>
<pubDate>{{ post.publicationDateStart | date('c', 'UTC') }}</pubDate>

EDIT: Maybe constant('DateTimeInterface::ATOM') could be better, since "c" represents ISO8601 while you was using ATOM.

@greg0ire greg0ire merged commit 292a70a into sonata-project:3.x May 2, 2020
@greg0ire
Copy link
Contributor

greg0ire commented May 2, 2020

Thanks @core23 !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants