From 9813ace62a694b7c53cdbceda6c4a2f5eac3bdd0 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 6 Feb 2020 20:48:05 +0100 Subject: [PATCH] Support hours greater than 99 when formatting timedelta time's issue9016 review258701002 --- src/common.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common.js b/src/common.js index 6e0b0690cb..3042d3a78e 100644 --- a/src/common.js +++ b/src/common.js @@ -355,10 +355,11 @@ } if (jQuery(values.slice(-3)).is(function(i, v) { return v; }) || jQuery.isEmptyObject(text)) { - var time = values.slice(-3, -1); - time = ('00' + time[0]).slice(-2) + ':' + ('00' + time[1]).slice(-2); - if (values.slice(-1)[0] || value) { - time += ':' + ('00' + values.slice(-1)[0]).slice(-2); + var time_values = values.slice(-3); + var time = time_values[0].toString().padStart(2, "0"); + time += ":" + time_values[1].toString().padStart(2, "0"); + if (time_values[2] || value) { + time += ':' + time_values[2].toString().padStart(2, "0"); } text.push(time); }