Round time values in get_age() to better approximate the actual age (#37125)

This commit is contained in:
Jelle Raaijmakers authored and GitHub committed 2020-07-09 11:19:38 -07:00
1 parent 511da9557b
commit ef254a1c3d
2 files changed
+16 -26

No files matched your search

+3
View File
@@ -162,6 +162,9 @@ def test_get_age():
diff = dt_util.now() - timedelta(minutes=320)
assert dt_util.get_age(diff) == "5 hours"
diff = dt_util.now() - timedelta(minutes=1.6 * 60 * 24)
assert dt_util.get_age(diff) == "2 days"
diff = dt_util.now() - timedelta(minutes=2 * 60 * 24)
assert dt_util.get_age(diff) == "2 days"