Skip to content

Commit

Permalink
Make time format consistently prominent and show dmy before time zones
Browse files Browse the repository at this point in the history
  • Loading branch information
shushugah committed Apr 1, 2024
1 parent 5d16886 commit e3fff66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions _includes/event-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@
style="--stack-spacing: 0.25rem"
>
<time datetime="{{ event.date }}">
<b>{{ event.date | all_time_zones: event.time_zones }}</b>
<b><h3>{{ event.date | all_time_zones: event.time_zones }}</h3></b>
</time>
{% if include.limit %}
<h3>
<a href="{{ event.url }}">{{ event.title }}</a>
</h3>
{% else %}
<h2>
<a href="{{ event.url }}">{{ event.title }}</a>
</h2>
{% endif %}
</div>
</article>
4 changes: 2 additions & 2 deletions _plugins/time_zones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def all_time_zones(date, timezones)
date.getlocal(
TZInfo::Timezone.get(tz)
).strftime("%R %Z")
}.join(", ") + dmy(date, timezones)
}.join(", ").prepend dmy(date, timezones)
end

private
def dmy(date, timezones)
date.getlocal(TZInfo::Timezone.get(timezones.first)).strftime(" %A, %d %B %Y")
date.getlocal(TZInfo::Timezone.get(timezones.first)).strftime("%d %B %Y")
end
end
end
Expand Down

0 comments on commit e3fff66

Please sign in to comment.