mirror of
https://github.com/topydo/topydo.git
synced 2024-05-20 13:58:33 +00:00
Convert timestamp to float before using with arrow
arrow>=0.15.0 doesn't accept timestamps given as `str`. Unfortunately `json` used in ChangeSet doesn't preserve `float` type in dictionary keys and always converts it to `str`. This leaded to feeding `arrow` with unsupported strings. Read note at: https://docs.python.org/3/library/json.html#json.dumps for further explanation. This fixes #271 and #274
This commit is contained in:
parent
2c28d2196f
commit
37fcd38d61
|
@ -98,7 +98,7 @@ class RevertCommand(Command):
|
|||
num = 1
|
||||
for timestamp, change in self._backup:
|
||||
label = change[2]
|
||||
time = arrow.get(timestamp).format('YYYY-MM-DD HH:mm:ss')
|
||||
time = arrow.get(float(timestamp)).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
self.out('{0: >3}| {1} | {2}'.format(str(num), time, label))
|
||||
num += 1
|
||||
|
|
Loading…
Reference in a new issue