Answers.Body: <p>Sounds to me like you need to use the Twig <a href="http://twig.sensiolabs.org/doc/filters/format.html" rel="nofollow noreferrer">format</a> filter, I have helped another user out with it <a href="https://craftcms.stackexchange.com/questions/5111/how-do-i-format-the-date-and-time-i-got-from-an-entry/5112#5112">here</a>.</p>
  
  <p>So if you want to output the month as a name (January, February etc), you can use this:</p>
  
  <pre><code>&lt;h2&gt;{{ entry.entryDate|format('F') }}&lt;/h2&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T16:31:15.263Z
Answers.Text: no that breaks it and nothing shows. Which is why I am struggling with this since yesterday now.
Answers.UserDisplayName: Rockwell Rice
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-06T21:55:21.183Z
Answers.Text: Probably a typo but it should be ``{{entry.entryDate.format('F')}}``... note the dot instead of the pipe to call format(). If you use the pipe, you're calling Twig's ``format`` filter (which is like printf). If you use ``.format()`` you're calling Craft's internal method which functions like Twig's ``date()``.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-08T13:25:47.783Z
Answers.Text: So every time (including your code above) I try to format that code inside the h2 it breaks. Dot or pipe, both break it and nothing shows.
Answers.UserDisplayName: Rockwell Rice
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T08:08:31.400Z
Answers.LastActivityDate: 2015-09-04T08:08:31.400Z
Answers.LastEditDate: 2017-04-13T12:50:59.930Z
Answers.UserDisplayName: Jamie Wade
Answers.Body: <p>You are using <code>entry</code> for two different things. <code>&lt;h2&gt;{{entry.entryDate|date('M')}}&lt;/h2&gt;</code> is the entry for the page, and will always be the same. <code>&lt;p&gt;{{entry.entryDate.month}}...</code> is the current entry in <code>entriesInMonth</code>, and will be different each time through the loop.</p>
  
  <p>Here is your current code with some of the html removed for simplicity, and some of the variable names changed for clarity:</p>
  
  <pre><code>{% set allTours = craft.entries.section('tours').find() %}
  {% set allToursByMonth = allTours|group('entryDate.month') %}
  
  {% for month, toursInMonth in allToursByMonth %}
      {# this entry will be the same every time around the loop #}
      &lt;h2&gt;{{entry.entryDate|date('M')}}&lt;/h2&gt;
      {% for tour in toursInMonth %}
          &lt;p&gt;{{tour.entryDate.month}}.{{tour.entryDate.day}}.{{tour.entryDate.year}}&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;{{tour.locationCity}}, {{tour.locationState}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="/tours/{{tour.slug}}" class="btn btn-primary btn-md" style="float:right;"&gt;register&lt;/a&gt;&lt;/p&gt;
      {% endfor %}        
  {% endfor%}
  </code></pre>
  
  <p>Probably what you want to display in that <code>&lt;h2&gt;</code> is the current <code>month</code> from the outer <code>for</code> loop:</p>
  
  <pre><code>&lt;h2&gt;{{month|date('M')}}&lt;/h2&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T20:35:54.147Z
Answers.Text: You are correct with what I am trying to do, however with your code (or any variations of it that I have tried) it still shows same month for each section.  I added a picture so you can see what I am getting.
Answers.UserDisplayName: Rockwell Rice
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T21:03:24.777Z
Answers.Text: @RockwellRice your key in `{% for month, toursInMonth in allToursByMonth %}` is already formatted. Change `<h2>{{entry.entryDate|date('M')}}</h2>` to `<h2>{{ month )}}</h2>` and you should be good.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T22:05:28.587Z
Answers.Text: All that does is output the number, I need to format it to display the text.  So, back to the original question of how do I format that to display the date in text.
Answers.UserDisplayName: Rockwell Rice
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-06T19:12:10.850Z
Answers.Text: That broke the grouping and only displayed the date as a number.
Answers.UserDisplayName: Rockwell Rice
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T20:22:36.300Z
Answers.LastActivityDate: 2015-09-04T20:22:36.300Z
Answers.UserDisplayName: Marion Newlevant
Answers.Body: <p>Unsure if you still need this, but I found a workaround for your issue.
  I was also having the same issue when formatting it either broke the output using a filter on the formatted month or it just showed 'January'.</p>
  
  <p>My code was initially similar to yours and I used the '|date('F')' filter on the initial entry postdate to show the month name. </p>
  
  <p>Try and change this part of your output:</p>
  
  <pre><code>{{entry.entryDate.month}}
  </code></pre>
  
  <p>to</p>
  
  <pre><code>{{entry.entryDate|date('F')}}
  </code></pre>
  
  <p>Hopefully this works for you too.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T20:54:37.993Z
Answers.LastActivityDate: 2016-02-22T20:54:37.993Z
Answers.UserDisplayName: Shaun Hall
Answers.Body: <p>I would suggest to already format entryDate within the <code>group</code> filter in the way you actually want to output it later.
  To do that use Twig's <a href="http://twig.sensiolabs.org/doc/filters/date.html" rel="nofollow"><code>date</code></a> filter (→ see all possible <a href="http://php.net/manual/en/function.date.php" rel="nofollow">formatting options</a>).</p>
  
  <pre><code>{% set allEntries = craft.entries.section('tours').find() %}
  {% set allEntriesByMonth = allEntries|group('entryDate|date("F")') %}
  
  {% for month, entriesInMonth in allEntriesByMonth %}
      &lt;h2&gt;{{ month }}&lt;/h2&gt;
  
      {% for entry in entriesInMonth %}
          &lt;div&gt;{{ entry.entryDate|date('m.d.Y') }}&lt;/div&gt;
      {% endfor %}
  {% endfor%}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-06T19:58:01.843Z
Answers.LastActivityDate: 2015-09-06T19:58:01.843Z
Answers.UserDisplayName: carlcs
Body: <p>I have events that are presented by month.  Right now they are being separated by Month but the heading for each chunk shows January as the month for each one.  Not sure why, or how to fix it, am interested in understanding both.  I am somewhat new to craft.  </p>
  
  <pre><code> &lt;div class="container"&gt;
  
  {% if entry.heading is defined %}&lt;h1&gt;{{ entry.heading }}&lt;/h1&gt;{% endif %}
  
  {% set allEntries = craft.entries.section('tours').find() %}
  {% set allEntriesByMonth = allEntries|group('entryDate.month') %}
  
  {% for month, entriesInMonth in allEntriesByMonth %}
      &lt;h2&gt;{{entry.entryDate|date('M')}}&lt;/h2&gt;
          {% for entry in entriesInMonth %}
              &lt;div class="row" style="padding-bottom: 25px;"&gt;
                  &lt;div class="col-md-12"&gt;
  
                      &lt;div style="border-bottom: 1px solid #d4d4d4;width:100%;"&gt;
                          &lt;p&gt;{{entry.entryDate.month}}.{{entry.entryDate.day}}.{{entry.entryDate.year}}&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;{{entry.locationCity}}, {{entry.locationState}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="/tours/{{entry.slug}}" class="btn btn-primary btn-md" style="float:right;"&gt;register&lt;/a&gt;&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          {% endfor %}        
  {% endfor%}
  </code></pre>
  
  <p></p>
  
  <p>I am trying to adjust the <code>h2</code> with <code>|date('M')</code> in order to display the date as text.  If I do not do that it displays the correct month number, but when I try to format it it breaks and displays the same month for all entries even though it is still ordering them.  So how can I format this to show month as text without breaking it?</p>
  
  <p>Any attempt to format the date breaks it. The dates below should be september and october.</p>
  
  <p><a href="https://i.sstatic.net/pR9iU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pR9iU.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-03T20:52:42.960Z
Comments.Text: it is the name of the field that the event happens on, it is set when creating the entry
Comments.UserDisplayName: Rockwell Rice
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-03T20:53:41.503Z
Comments.Text: How is the output from `entry.entryDate` formatted? Maybe the output isn't what the date filter expects?
Comments.UserDisplayName: megatrond
Tags: <templating><datetime>
Title: How to properly format this date
ThreadText: # How to properly format this date
  
  (Asked by: username_0 on 2015-09-03)
  
  I have events that are presented by month. Right now they are being separated by Month but the heading for each chunk shows January as the month for each one. Not sure why, or how to fix it, am interested in understanding both. I am somewhat new to craft.
  
  ```
   <div class="container">
  
  {% if entry.heading is defined %}<h1>{{ entry.heading }}</h1>{% endif %}
  
  {% set allEntries = craft.entries.section('tours').find() %}
  {% set allEntriesByMonth = allEntries|group('entryDate.month') %}
  
  {% for month, entriesInMonth in allEntriesByMonth %}
      <h2>{{entry.entryDate|date('M')}}</h2>
          {% for entry in entriesInMonth %}
              <div class="row" style="padding-bottom: 25px;">
                  <div class="col-md-12">
  
                      <div style="border-bottom: 1px solid #d4d4d4;width:100%;">
                          <p>{{entry.entryDate.month}}.{{entry.entryDate.day}}.{{entry.entryDate.year}}&nbsp;&nbsp;-&nbsp;&nbsp;{{entry.locationCity}}, {{entry.locationState}}&nbsp;&nbsp;&nbsp;<a href="/tours/{{entry.slug}}" class="btn btn-primary btn-md" style="float:right;">register</a></p>
                      </div>
                  </div>
              </div>
          {% endfor %}        
  {% endfor%}
  
  ```
  
  I am trying to adjust the `h2` with `|date('M')` in order to display the date as text. If I do not do that it displays the correct month number, but when I try to format it it breaks and displays the same month for all entries even though it is still ordering them. So how can I format this to show month as text without breaking it?
  
  Any attempt to format the date breaks it. The dates below should be september and october.
  
  [![enter image description here](https://i.sstatic.net/pR9iU.png)](https://i.sstatic.net/pR9iU.png)
  
  **Tags:** templating, datetime
  
  > **Comments:**
  > **username_0**: it is the name of the field that the event happens on, it is set when creating the entry  
  > **username_1**: How is the output from `entry.entryDate` formatted? Maybe the output isn't what the date filter expects?  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_5 on 2015-09-06. Score: 4 | Accepted answer
  
  I would suggest to already format entryDate within the `group` filter in the way you actually want to output it later.
  To do that use Twig's [`date`](http://twig.sensiolabs.org/doc/filters/date.html) filter (→ see all possible [formatting options](http://php.net/manual/en/function.date.php)).
  
  ```
  {% set allEntries = craft.entries.section('tours').find() %}
  {% set allEntriesByMonth = allEntries|group('entryDate|date("F")') %}
  
  {% for month, entriesInMonth in allEntriesByMonth %}
      <h2>{{ month }}</h2>
  
      {% for entry in entriesInMonth %}
          <div>{{ entry.entryDate|date('m.d.Y') }}</div>
      {% endfor %}
  {% endfor%}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2015-09-04. Score: 2
  
  Sounds to me like you need to use the Twig [format](http://twig.sensiolabs.org/doc/filters/format.html) filter, I have helped another user out with it [here](https://craftcms.stackexchange.com/questions/5111/how-do-i-format-the-date-and-time-i-got-from-an-entry/5112#5112).
  
  So if you want to output the month as a name (January, February etc), you can use this:
  
  ```
  <h2>{{ entry.entryDate|format('F') }}</h2>
  
  ```
  
  > **Comments:**
  > **username_0**: no that breaks it and nothing shows. Which is why I am struggling with this since yesterday now.  
  > **username_3**: Probably a typo but it should be ``{{entry.entryDate.format('F')}}``... note the dot instead of the pipe to call format(). If you use the pipe, you're calling Twig's ``format`` filter (which is like printf). If you use ``.format()`` you're calling Craft's internal method which functions like Twig's ``date()``.  
  > **username_0**: So every time (including your code above) I try to format that code inside the h2 it breaks. Dot or pipe, both break it and nothing shows.  
  
  ---
  
  ### Answer by username_4 on 2015-09-04. Score: 2
  
  You are using `entry` for two different things. `<h2>{{entry.entryDate|date('M')}}</h2>` is the entry for the page, and will always be the same. `<p>{{entry.entryDate.month}}...` is the current entry in `entriesInMonth`, and will be different each time through the loop.
  
  Here is your current code with some of the html removed for simplicity, and some of the variable names changed for clarity:
  
  ```
  {% set allTours = craft.entries.section('tours').find() %}
  {% set allToursByMonth = allTours|group('entryDate.month') %}
  
  {% for month, toursInMonth in allToursByMonth %}
      {# this entry will be the same every time around the loop #}
      <h2>{{entry.entryDate|date('M')}}</h2>
      {% for tour in toursInMonth %}
          <p>{{tour.entryDate.month}}.{{tour.entryDate.day}}.{{tour.entryDate.year}}&nbsp;&nbsp;-&nbsp;&nbsp;{{tour.locationCity}}, {{tour.locationState}}&nbsp;&nbsp;&nbsp;<a href="/tours/{{tour.slug}}" class="btn btn-primary btn-md" style="float:right;">register</a></p>
      {% endfor %}        
  {% endfor%}
  
  ```
  
  Probably what you want to display in that `<h2>` is the current `month` from the outer `for` loop:
  
  ```
  <h2>{{month|date('M')}}</h2>
  
  ```
  
  > **Comments:**
  > **username_0**: You are correct with what I am trying to do, however with your code (or any variations of it that I have tried) it still shows same month for each section.  I added a picture so you can see what I am getting.  
  > **username_5**: @username_0 your key in `{% for month, toursInMonth in allToursByMonth %}` is already formatted. Change `<h2>{{entry.entryDate|date('M')}}</h2>` to `<h2>{{ month )}}</h2>` and you should be good.  
  > **username_0**: All that does is output the number, I need to format it to display the text.  So, back to the original question of how do I format that to display the date in text.  
  > **username_0**: That broke the grouping and only displayed the date as a number.  
  
  ---
  
  ### Answer by username_6 on 2016-02-22. Score: 1
  
  Unsure if you still need this, but I found a workaround for your issue.
  I was also having the same issue when formatting it either broke the output using a filter on the formatted month or it just showed 'January'.
  
  My code was initially similar to yours and I used the '|date('F')' filter on the initial entry postdate to show the month name.
  
  Try and change this part of your output:
  
  ```
  {{entry.entryDate.month}}
  
  ```
  
  to
  
  ```
  {{entry.entryDate|date('F')}}
  
  ```
  
  Hopefully this works for you too.
  
  
  ---
  
  