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

Ordinalize should use the full month name #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/octopress-date-format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def format_time(date, html=false)

# Returns an ordidinal date eg July 22 2007 -> July 22nd 2007
def ordinalize(date)
"#{date.strftime('%b %-d')}#{ordinal_suffix(date)}, #{date.strftime('%Y')}"
"#{date.strftime('%B %-d')}#{ordinal_suffix(date)}, #{date.strftime('%Y')}"
end

def ordinalize_html(date)
d = "<span class='date-month'>#{date.strftime('%b')}</span> "
d = "<span class='date-month'>#{date.strftime('%B')}</span> "
d += "<span class='date-day'>#{date.strftime('%-d')}</span>"
d += "<span class='date-suffix'>#{ordinal_suffix(date)}</span>, "
d += "<span class='date-year'>#{date.strftime('%Y')}</span>"
Expand Down
12 changes: 6 additions & 6 deletions test/_expected/2014/07/03/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<h2 id="date">Date</h2>
<ul>
<li>Date: 2014-07-03 14:08:00 +0000</li>
<li>Formatted Date: Jul 3rd, 2014</li>
<li>Formatted Date: July 3rd, 2014</li>
<li>Formatted Time: 2:08 pm</li>
<li>Date XML: 2014-07-03T14:08:00+00:00</li>
<li>Date HTML: <time class="entry-date" datetime="2014-07-03T14:08:00+00:00"><span class="date"><span class="date-month">Jul</span> <span class="date-day">3</span><span class="date-suffix">rd</span>, <span class="date-year">2014</span></span></time></li>
<li>Date Time HTML: <time class="entry-date" datetime="2014-07-03T14:08:00+00:00"><span class="date"><span class="date-month">Jul</span> <span class="date-day">3</span><span class="date-suffix">rd</span>, <span class="date-year">2014</span></span> <span class="time">2:08 pm</span></time></li>
<li>Date HTML: <time class="entry-date" datetime="2014-07-03T14:08:00+00:00"><span class="date"><span class="date-month">July</span> <span class="date-day">3</span><span class="date-suffix">rd</span>, <span class="date-year">2014</span></span></time></li>
<li>Date Time HTML: <time class="entry-date" datetime="2014-07-03T14:08:00+00:00"><span class="date"><span class="date-month">July</span> <span class="date-day">3</span><span class="date-suffix">rd</span>, <span class="date-year">2014</span></span> <span class="time">2:08 pm</span></time></li>
</ul>

<h2 id="updated">Updated</h2>
<ul>
<li>Date: 2014-07-04 16:03:05 +0000</li>
<li>Formatted Date: Jul 4th, 2014</li>
<li>Formatted Date: July 4th, 2014</li>
<li>Formatted Time: 4:03 pm</li>
<li>XML: 2014-07-04T16:03:05+00:00</li>
<li>HTML: <time class="updated" datetime="2014-07-04T16:03:05+00:00"><span class="date"><span class="date-month">Jul</span> <span class="date-day">4</span><span class="date-suffix">th</span>, <span class="date-year">2014</span></span></time></li>
<li>Date Time HTML: <time class="updated" datetime="2014-07-04T16:03:05+00:00"><span class="date"><span class="date-month">Jul</span> <span class="date-day">4</span><span class="date-suffix">th</span>, <span class="date-year">2014</span></span> <span class="time">4:03 pm</span></time></li>
<li>HTML: <time class="updated" datetime="2014-07-04T16:03:05+00:00"><span class="date"><span class="date-month">July</span> <span class="date-day">4</span><span class="date-suffix">th</span>, <span class="date-year">2014</span></span></time></li>
<li>Date Time HTML: <time class="updated" datetime="2014-07-04T16:03:05+00:00"><span class="date"><span class="date-month">July</span> <span class="date-day">4</span><span class="date-suffix">th</span>, <span class="date-year">2014</span></span> <span class="time">4:03 pm</span></time></li>
</ul>

12 changes: 6 additions & 6 deletions test/_expected/2014/07/03/welcome-to-jekyll.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

## Date
- Date: 2014-07-03 14:08:00 +0000
- Formatted Date: Jul 3rd, 2014
- Formatted Date: July 3rd, 2014
- Formatted Time: 2:08 pm
- Date XML: 2014-07-03T14:08:00+00:00
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>


## Updated
- Date: 2014-07-03 15:03:15 +0000
- Formatted Date: Jul 3rd, 2014
- Formatted Date: July 3rd, 2014
- Formatted Time: 3:03 pm
- XML: 2014-07-03T15:03:15+00:00
- HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>
- HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>


24 changes: 12 additions & 12 deletions test/_expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

## Date
- Date: 2014-07-03 14:08:00 +0000
- Formatted Date: Jul 3rd, 2014
- Formatted Date: July 3rd, 2014
- Formatted Time: 2:08 pm
- Date XML: 2014-07-03T14:08:00+00:00
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>


## Updated
- Date: 2014-07-03 15:03:15 +0000
- Formatted Date: Jul 3rd, 2014
- Formatted Date: July 3rd, 2014
- Formatted Time: 3:03 pm
- XML: 2014-07-03T15:03:15+00:00
- HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>
- HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>



Expand All @@ -26,20 +26,20 @@

## Date
- Date: 2014-07-03 14:08:00 +0000
- Formatted Date: Jul 3rd, 2014
- Formatted Date: July 3rd, 2014
- Formatted Time: 2:08 pm
- Date XML: 2014-07-03T14:08:00+00:00
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
- Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>


## Updated
- Date: 2014-07-04 16:03:05 +0000
- Formatted Date: Jul 4th, 2014
- Formatted Date: July 4th, 2014
- Formatted Time: 4:03 pm
- XML: 2014-07-04T16:03:05+00:00
- HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span> <span class='time'>4:03 pm</span></time>
- HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span></time>
- Date Time HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>July</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span> <span class='time'>4:03 pm</span></time>



6 changes: 3 additions & 3 deletions test/_expected/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

## Date
- Date: 2013-08-16 14:08:15 +0000
- Formatted Date: Aug 16th, 2013
- Formatted Date: August 16th, 2013
- Formatted Time: 2:08 pm
- Date XML: 2013-08-16T14:08:15+00:00
- Date HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>Aug</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>Aug</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span> <span class='time'>2:08 pm</span></time>
- Date HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>August</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span></time>
- Date Time HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>August</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span> <span class='time'>2:08 pm</span></time>