mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 06:50:52 +00:00
Merge pull request #1625 from DanielDent/patch-1
Add support for durations in minutes
This commit is contained in:
commit
0964005d84
1 changed files with 3 additions and 2 deletions
|
@ -64,11 +64,12 @@ class Config(object):
|
||||||
if isinstance(value, int) or isinstance(value, long):
|
if isinstance(value, int) or isinstance(value, long):
|
||||||
return value
|
return value
|
||||||
second = 1000
|
second = 1000
|
||||||
hour = 60 * 60 * second
|
minute = 60 * second
|
||||||
|
hour = 60 * minute
|
||||||
day = 24 * hour
|
day = 24 * hour
|
||||||
week = 7 * day
|
week = 7 * day
|
||||||
year = 365 * day
|
year = 365 * day
|
||||||
sizes = {"s": second, "h": hour, "d": day, "w": week, "y": year}
|
sizes = {"s": second, "m": minute, "h": hour, "d": day, "w": week, "y": year}
|
||||||
size = 1
|
size = 1
|
||||||
suffix = value[-1]
|
suffix = value[-1]
|
||||||
if suffix in sizes:
|
if suffix in sizes:
|
||||||
|
|
Loading…
Reference in a new issue