3

I have a site with 2 languages: Nl and En Everything translates to Dutch but only the date stays in English...

I use this to get my news items:

{% for entry in craft.entries.section('news').limit(6).find() %}
    <li>
              <p>{{ entry.title}} {{ entry.postDate.format('d M Y') }}</p>
              <a href="{{ entry.url }}">{{ entry.title }}</a>
            </li>
{% endfor %}

The month stays in English, how can I format de post date, with the locale I'm viewing the site?

5

Instead of:

{{ entry.postDate.format('d M Y') }}

Use:

{{ entry.postDate | date('d M Y') }}

That should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.