blog-markdown #31
|
@ -1,4 +1,5 @@
|
|||
{% load i18n %}
|
||||
{% load helper_tags %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<div class="container-lg mt-5">
|
||||
<h4 class="">{% trans "Featured" %}</h4>
|
||||
|
@ -45,6 +46,12 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="container p-1 text-center" style="border-top: solid">
|
||||
<li class="list-group-item">
|
||||
{% format_time post.date "%F" as date %}
|
||||
{% trans "published" %}: {{ date }}
|
||||
</li>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
|
@ -11,8 +11,8 @@ logger = logging.getLogger(__name__)
|
|||
register = Library()
|
||||
|
||||
@register.simple_tag
|
||||
def format_time(timestamp: datetime) -> str:
|
||||
return timestamp.strftime("%F %H:%M:%S")
|
||||
def format_time(timestamp: datetime, format: str = "%F %H:%M:%S") -> str:
|
||||
return timestamp.strftime(format)
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def change_lang(context, lang="de", *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue