2020-07-23 17:23:31 +03:00
|
|
|
<!--
|
|
|
|
Date format snippet
|
2021-12-04 01:56:33 +03:00
|
|
|
See: ${JS_ROOT}/utils/timeago.js
|
2020-07-23 17:23:31 +03:00
|
|
|
-->
|
2021-01-23 22:02:19 +03:00
|
|
|
|
2021-08-01 16:54:27 +03:00
|
|
|
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
|
|
|
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
|
|
|
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
2021-01-23 22:02:19 +03:00
|
|
|
|
2021-12-04 01:56:33 +03:00
|
|
|
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
|
2022-01-24 20:18:25 +03:00
|
|
|
date="{{ include.date | date_to_xmlschema }}"
|
2021-12-04 01:56:33 +03:00
|
|
|
{% if include.tooltip %}
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="bottom"
|
|
|
|
title="{{ include.date | date: tooltip_df }}"
|
|
|
|
{% endif %}>
|
|
|
|
|
2021-07-20 20:01:09 +03:00
|
|
|
{%- assign this_year = site.time | date: "%Y" -%}
|
|
|
|
{%- assign post_year = include.date | date: "%Y" -%}
|
2021-12-04 01:56:33 +03:00
|
|
|
|
2021-07-20 20:01:09 +03:00
|
|
|
{%- if post_year == this_year -%}
|
2021-01-23 22:02:19 +03:00
|
|
|
{{ include.date | date: post_short_df }}
|
2021-07-20 20:01:09 +03:00
|
|
|
{%- else -%}
|
2021-01-23 22:02:19 +03:00
|
|
|
{{ include.date | date: post_long_df }}
|
2021-07-20 20:01:09 +03:00
|
|
|
{%- endif -%}
|
2021-12-04 01:56:33 +03:00
|
|
|
</em>
|