fix: return datetime instead of timestamp (to stay consistent)

pull/29/head
Sami Mokaddem 2017-12-07 13:03:52 +01:00
parent 15e199d86c
commit 2c3f17c4a9
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class Users_helper:
keyname = "{}:{}".format(self.keyTimestamp, org) keyname = "{}:{}".format(self.keyTimestamp, org)
timestamps = self.serv_redis_db.zrange(keyname, 0, -1, desc=True, withscores=True) timestamps = self.serv_redis_db.zrange(keyname, 0, -1, desc=True, withscores=True)
if date is None: if date is None:
to_return = [ t[1] for t in timestamps ] to_return = [ datetime.datetime.fromtimestamp(float(t[1])) for t in timestamps ]
else: else:
to_return = [] to_return = []
for t in timestamps: for t in timestamps:
@ -165,7 +165,7 @@ class Users_helper:
data.append(to_append) data.append(to_append)
except KeyError: # no data except KeyError: # no data
data.append([0 for x in range(24)]) data.append([0 for x in range(24)])
# swap: punchcard day starts on monday # swap: punchcard day starts on sunday
data = [data[6]]+data[:6] data = [data[6]]+data[:6]
return data return data