Commit 77334780 by Kálmán Viktor

dashboard: remove unused store_tags file

parent 9890bbc0
from datetime import datetime
from django import template
from django.utils.timesince import timesince
register = template.Library()
@register.simple_tag(name="bytes_to_megabytes")
def bytes_to_megabytes(size):
if size:
return size / (1024 * 1024)
else:
return 0
@register.simple_tag(name="timestamp_to_date")
def timestamp_to_date(timestamp):
date = datetime.fromtimestamp(float(timestamp))
if (datetime.now() - date).days < 1:
date = timesince(date)
return date
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment