From fc63d036e2f60e7e11fadd64c4f2e35e4bd4d50a Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Thu, 28 Jul 2022 17:10:57 +0300 Subject: [PATCH] Use empty string in favour of regex in `String.replace` --- assets/js/dashboard/stats/graph/graph-util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/dashboard/stats/graph/graph-util.js b/assets/js/dashboard/stats/graph/graph-util.js index 3e67e4273..c0729fe28 100644 --- a/assets/js/dashboard/stats/graph/graph-util.js +++ b/assets/js/dashboard/stats/graph/graph-util.js @@ -19,7 +19,7 @@ export const dateFormatter = (interval, longForm) => { date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]) var hours = Intl.DateTimeFormat(navigator.language, { hour: 'numeric' }).format(date); if (uses12hTime) { - hours = hours.toLowerCase().replace(/\s/g, ""); + hours = hours.toLowerCase().replace(" ", ""); } else { hours = hours.concat("h"); }