Skip to content
Snippets Groups Projects
Commit f1cdb291 authored by Seblu's avatar Seblu
Browse files

make date/time tagdisplay convertion only if decimal

parent 69bfc344
No related branches found
No related tags found
No related merge requests found
......@@ -149,15 +149,21 @@ class TagDisplay(object):
def type_date(self, value):
'''date type'''
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%d/%m/%Y")
if value.isdecimal():
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%d/%m/%Y")
return value
def type_time(self, value):
'''date type'''
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%H:%M:%S")
if value.isdecimal():
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%H:%M:%S")
return value
def type_datetime(self, value):
'''date type'''
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%d/%m/%Y %H:%M:%S")
if value.isdecimal():
d = datetime.datetime.fromtimestamp(float(value))
return d.strftime("%d/%m/%Y %H:%M:%S")
return value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment