mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make sure 'no date' elements do not fail
This commit is contained in:
parent
776138f2e2
commit
4e832bb9ac
@ -5,7 +5,7 @@ This module provides template tags for extra functionality,
|
||||
over and above the built-in Django tags.
|
||||
"""
|
||||
|
||||
from datetime import date
|
||||
from datetime import date, datetime
|
||||
import os
|
||||
import sys
|
||||
|
||||
@ -87,7 +87,9 @@ def render_date(context, date_object):
|
||||
# Update the context cache
|
||||
context['user_date_format'] = user_date_format
|
||||
|
||||
if isinstance(date_object, (datetime, date)):
|
||||
return date_object.strftime(user_date_format)
|
||||
return date_object
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
|
Loading…
Reference in New Issue
Block a user