Added support for JS date format escape sequences
authorAlexander Ebert <ebert@woltlab.com>
Tue, 25 Apr 2017 16:29:46 +0000 (18:29 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 25 Apr 2017 16:29:53 +0000 (18:29 +0200)
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Util.js

index 7dfb376b97d04c4b1e14392a1f05ff2e9437d505..78879e4600849804fe0c46f3e6dc0b68f9aa511b 100644 (file)
@@ -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}',
index f2c00c3688d47ea5b7409e7d6cbffb1b8989ac89..692de842d1ec5ec6e221858c425d1a6a8cdeb280 100644 (file)
@@ -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}',
index aac63811eb456784f96fc64611c1934b7b4f959f..5447d740144380590b66f0ab5e3c3e4da9e65d4a 100644 (file)
@@ -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];