Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change how date is displayed on teaching page? #2844

Answered by rjzupkoii
nwarford asked this question in Q&A
Discussion options

I'd like to be able to include either month or season in addition to the year on my teaching page, so it's easier to distinguish between different semesters of a course I've taught multiple times. As an example, the ISO dates for the 2 CSCI 150 courses in the attached image are 2024年08月01日 and 2024年02月01日 respectively, so I was hoping there would be a way to change how these were displayed, but that's beyond what I've been able to find!

Screenshot 2025年02月16日 at 3 28 03 PM
You must be logged in to vote

In _includes/archivbe-single.html look for the following (lines 41 to 47):

 {% if post.collection == 'teaching' %}
 <p> {{ post.type }}, <i>{{ post.venue }}</i>, {{ post.date | default: "1900-01-01" | date: "%Y" }} </p>
 {% elsif post.collection == 'publications' %}
 <p>Published in <i>{{ post.venue }}</i>, {{ post.date | default: "1900-01-01" | date: "%Y" }} </p>
 {% elsif post.date %}
 <p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Published:" }}</strong> <time datetime="{{ post.date | default: "1900年01月01日" | date_to_xmlschema }}">{{ post.date | ...

Replies: 1 comment 1 reply

Comment options

In _includes/archivbe-single.html look for the following (lines 41 to 47):

 {% if post.collection == 'teaching' %}
 <p> {{ post.type }}, <i>{{ post.venue }}</i>, {{ post.date | default: "1900-01-01" | date: "%Y" }} </p>
 {% elsif post.collection == 'publications' %}
 <p>Published in <i>{{ post.venue }}</i>, {{ post.date | default: "1900-01-01" | date: "%Y" }} </p>
 {% elsif post.date %}
 <p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Published:" }}</strong> <time datetime="{{ post.date | default: "1900年01月01日" | date_to_xmlschema }}">{{ post.date | default: "1900-01-01" | date: "%B %d, %Y" }}</time></p>
 {% endif %}

The line you are going to want to change immediately follows {% if post.collection == 'teaching' %}. The date using Liquid syntax so you need to use the formatting as documented here.

You must be logged in to vote
1 reply
Comment options

Thanks so much! That worked a treat, and the linked formatting doc was really helpful too.

Answer selected by nwarford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /