Back to ProBlog Support

tony7134
tony7134

is there a filter or something change the month in archive live to a spelled out month.

for example, for the month january i want jan instead 01

im working this code:

{% if post_m not in months %}
              {% if months|length > 0 %}{% endif %}
              {% set months = months|merge([post_m]) %}
              {{post_m}}
          {% endif %}

Last updated

ChadStrat
ChadStrat

I believe there is a twig filter for that. Have you tried searching the twig docs?

ninjas8732
ninjas8732

found it!

{% set post_m = post.published_at|date("M") %}

ChadStrat
ChadStrat

nice! thanks for reporting back!

MarekP
MarekP

Hi, guys, can I ask you for help? How about rendering the full MONTH NAME ? {{ post.published_at|date('d M Y') }} => I can get for example '8 Aug 2020' How can I get '8 August 2020' [August - instead Aug] ? I'll be very grateful for suggestions Cheers

ChadStrat
ChadStrat

Hi MarekP,

You want to create a partial in /partials/proEventsList/simple_list.htm (or whatever list view option you're choosing in the component. look in /plugins/radiantweb/proevents/components/eventlist to see available override views.) and copy the component list view code you'd like into that override partial. You can then edit this file and no plugin updates will effect your changes made. you can then change those date formatting to any PHP date formatting outlined here: https://www.php.net/manual/en/datetime.formats.date.php

MarekP
MarekP

Hi ChadStrat, thanks for feedback. Actually I can display the date without any issues and extra plugins. Just want to show FULL MONTH name. "January","February","March","April","May","June","July","August","September","October","November","December"

Not "Jan", "Feb" ect :_)

ChadStrat
ChadStrat

goodness....that's what I get for doing two things at once!! SOOOooo sorry.. I used the WRONG plugin name. haha. #fail. for PROBLOG you still DO want to create a /proBlogList/default.htm partial and copy all of the plugin view code into that before you edit. This makes any changes non-destructive. And then on line 18ish change 'M d, Y' to whatever date formatting you like using Twigs formatting guidance: https://www.php.net/manual/en/function.date.php

MarekP
MarekP

OK, I might be I am not clear. All what I want to achieve is:

8 August 2020

NOT a 8 Aug 2020 So you suggest to buy an extra ProBlog plugin to get that result?

Last updated

MarekP
MarekP

I asked one developer Guru (from Poland) and the solution seems to be very simple and works. The date format with the full name of the month looks like this:

{{post.published_at | date ('d F Y')}}

So "F" instead of "M"

Cheers

1-10 of 10