From: Alexander Ebert Date: Tue, 25 Apr 2017 16:29:46 +0000 (+0200) Subject: Added support for JS date format escape sequences X-Git-Tag: 3.0.5~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a7270728c65c976f2c7f95e4f857a767f23b1d1;p=GitHub%2FWoltLab%2FWCF.git Added support for JS date format escape sequences --- diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 7dfb376b97..78879e4600 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -41,7 +41,7 @@ requirejs.config({ 'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang __literal=true}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}', 'wcf.date.relative.hours': '{capture assign=relativeHours}{lang __literal=true}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}', 'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang __literal=true}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}', - 'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}', + 'wcf.date.dateFormat': '{"wcf.date.dateFormat"|language|encodeJS}', 'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}', 'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}', 'wcf.date.hour': '{lang}wcf.date.hour{/lang}', diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index f2c00c3688..692de842d1 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -55,7 +55,7 @@ 'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang __literal=true}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}', 'wcf.date.relative.hours': '{capture assign=relativeHours}{lang __literal=true}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}', 'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang __literal=true}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}', - 'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}', + 'wcf.date.dateFormat': '{"wcf.date.dateFormat"|language|encodeJS}', 'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}', 'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}', 'wcf.date.hour': '{lang}wcf.date.hour{/lang}', diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js index aac63811eb..5447d74014 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js @@ -179,6 +179,14 @@ define(['Language'], function(Language) { case 'U': char = Math.round(date.getTime() / 1000); break; + + // escape sequence + case '\\': + char = ''; + if (i + 1 < length) { + char = format[++i]; + } + break; default: char = format[i];