changeset 1d72d67b8787 in sao:5.4
details: https://hg.tryton.org/sao?cmd=changeset;node=1d72d67b8787
description:
Support hours greater than 99 when formatting timedelta time's
issue9016
review258701002
(grafted from e7aef9e5d26b3b7f57d6396a6fdeaa1b30954e93)
diffstat:
src/common.js | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (19 lines):
diff -r 7532e3d79e5e -r 1d72d67b8787 src/common.js
--- a/src/common.js Tue Feb 04 18:30:04 2020 +0100
+++ b/src/common.js Thu Feb 06 20:48:05 2020 +0100
@@ -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);
}