[Tile-serving] [openstreetmap/osm2pgsql] Make the display of time intervals show seconds. (PR #1977)

Sarah Hoffmann notifications at github.com
Mon Jun 26 14:57:36 UTC 2023


@lonvia commented on this pull request.



> -            output.append("{} day(s)".format(days))
-        if hours > 0 or days > 0 or weeks > 0:
-            output.append("{} hour(s)".format(hours))
-
-        output.append("{} minute(s)".format(minutes))
-        output = " ".join(output)
+    output = []
+    # If weeks > 1 but hours == 0, we still want to show "0 hours"
+    if weeks > 0:
+        output.append("{} week(s)".format(weeks))
+    if days > 0 or weeks > 0:
+        output.append("{} day(s)".format(days))
+    if hours > 0 or days > 0 or weeks > 0:
+        output.append("{} hour(s)".format(hours))
+
+    output.append("{} minute(s)".format(minutes))

This should now be conditional as well.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1977#pullrequestreview-1498755503
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/pull/1977/review/1498755503 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230626/0ca9ca5c/attachment.htm>


More information about the Tile-serving mailing list