Skip to content

Commit

Permalink
better typography
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 24, 2024
1 parent c86f360 commit 83f0b2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions _plugins/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ def collapse_event_date_pretty(event)
event['date_end']
end
# want dates like "Mar 22-25, 2024" or "Mar 22-May 1, 2024"
dash = " – " # thin space, en dash, thin space
if s.year == e.year
if s.month == e.month
if s.day == e.day
"#{s.strftime('%B')} #{s.day}, #{s.year}"
else
"#{s.strftime('%B')} #{s.day}-#{e.day}, #{s.year}"
"#{s.strftime('%B')} #{s.day}#{dash}#{e.day}, #{s.year}"
end
else
"#{s.strftime('%B')} #{s.day}-#{e.strftime('%B')} #{e.day}, #{s.year}"
"#{s.strftime('%B')} #{s.day}#{dash}#{e.strftime('%B')} #{e.day}, #{s.year}"
end
else
"#{s.strftime('%B')} #{s.day}, #{s.year}-#{e.strftime('%B')} #{e.day}, #{e.year}"
"#{s.strftime('%B')} #{s.day}, #{s.year}#{dash}#{e.strftime('%B')} #{e.day}, #{e.year}"
end
end

0 comments on commit 83f0b2b

Please sign in to comment.