From 7f3d889bede62fa3a6a565113fd9c52fc97aa79e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 24 Jan 2018 09:24:34 +0100 Subject: [PATCH] Added support for short year format. --- .../javascripts/app/lib/app_post/i18n.coffee | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/i18n.coffee b/app/assets/javascripts/app/lib/app_post/i18n.coffee index af8b5ef3d..6eff7b768 100644 --- a/app/assets/javascripts/app/lib/app_post/i18n.coffee +++ b/app/assets/javascripts/app/lib/app_post/i18n.coffee @@ -337,18 +337,20 @@ class _i18nSingleton extends Spine.Module if offset timeObject = new Date(timeObject.getTime() + (timeObject.getTimezoneOffset() * 60000)) - d = timeObject.getDate() - m = timeObject.getMonth() + 1 - y = timeObject.getFullYear() - S = timeObject.getSeconds() - M = timeObject.getMinutes() - H = timeObject.getHours() + d = timeObject.getDate() + m = timeObject.getMonth() + 1 + yfull = timeObject.getFullYear() + yshort = timeObject.getYear()-100 + S = timeObject.getSeconds() + M = timeObject.getMinutes() + H = timeObject.getHours() format = format .replace(/dd/, s(d, 2)) .replace(/d/, d) .replace(/mm/, s(m, 2)) .replace(/m/, m) - .replace(/yyyy/, y) + .replace(/yyyy/, yfull) + .replace(/yy/, yshort) .replace(/SS/, s(S, 2)) .replace(/MM/, s(M, 2)) .replace(/HH/, s(H, 2))