diff --git a/cypress/integration/origin-visits.spec.js b/cypress/integration/origin-visits.spec.js --- a/cypress/integration/origin-visits.spec.js +++ b/cypress/integration/origin-visits.spec.js @@ -31,7 +31,7 @@ .trigger('mouseenter') .get('.popover-body') .should('be.visible') - .and('contain', `${date.hours}:${date.minutes} UTC`); + .and('contain', `${date.hours}:${date.minutes}:${date.seconds} UTC`); } describe('Visits tests', function() { diff --git a/cypress/utils/index.js b/cypress/utils/index.js --- a/cypress/utils/index.js +++ b/cypress/utils/index.js @@ -22,7 +22,8 @@ monthName: date.toLocaleString('en', {month: 'long'}), year: date.getUTCFullYear(), hours: pad(date.getUTCHours()), - minutes: pad(date.getUTCMinutes()) + minutes: pad(date.getUTCMinutes()), + seconds: pad(date.getUTCSeconds()) }; return time; diff --git a/swh/web/common/utils.py b/swh/web/common/utils.py --- a/swh/web/common/utils.py +++ b/swh/web/common/utils.py @@ -158,7 +158,7 @@ return re.sub(sha1_re, r"\1...", ret) -def format_utc_iso_date(iso_date, fmt="%d %B %Y, %H:%M UTC"): +def format_utc_iso_date(iso_date, fmt="%d %B %Y, %H:%M:%S UTC"): """Turns a string representation of an ISO 8601 datetime string to UTC and format it into a more human readable one. diff --git a/swh/web/tests/common/test_utils.py b/swh/web/tests/common/test_utils.py --- a/swh/web/tests/common/test_utils.py +++ b/swh/web/tests/common/test_utils.py @@ -87,7 +87,7 @@ def test_format_utc_iso_date(): assert ( utils.format_utc_iso_date("2017-05-04T13:27:13+02:00") - == "04 May 2017, 11:27 UTC" + == "04 May 2017, 11:27:13 UTC" )