From 04aea92f8c48f2dd389a20a2dd6ece77ce2c2e78 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 4 Jan 2017 12:13:23 +0100 Subject: [PATCH] Improved performance. --- .../javascripts/app/lib/app_post/i18n.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/i18n.coffee b/app/assets/javascripts/app/lib/app_post/i18n.coffee index ba7ae9a5d..82efaaae9 100644 --- a/app/assets/javascripts/app/lib/app_post/i18n.coffee +++ b/app/assets/javascripts/app/lib/app_post/i18n.coffee @@ -313,12 +313,13 @@ class _i18nSingleton extends Spine.Module S = timeObject.getSeconds() M = timeObject.getMinutes() H = timeObject.getHours() - format = format.replace /dd/, s(d, 2) - format = format.replace /d/, d - format = format.replace /mm/, s(m, 2) - format = format.replace /m/, m - format = format.replace /yyyy/, y - format = format.replace /SS/, s(S, 2) - format = format.replace /MM/, s(M, 2) - format = format.replace /HH/, s(H, 2) + format = format + .replace(/dd/, s(d, 2)) + .replace(/d/, d) + .replace(/mm/, s(m, 2)) + .replace(/m/, m) + .replace(/yyyy/, y) + .replace(/SS/, s(S, 2)) + .replace(/MM/, s(M, 2)) + .replace(/HH/, s(H, 2)) format