From 0cabdb11b9573f3957adb951e53a46f260ceef00 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Thu, 24 Jan 2013 15:23:53 +0100 Subject: [PATCH] optimizing date format converter regex --- wcfsetup/install/files/js/WCF.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 9d6d0f5548..997baeece5 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2158,7 +2158,7 @@ WCF.Date.Picker = { // do the actual replacement // this is not perfect, but a basic implementation and should work in 99% of the cases // TODO: support literals (magics are escaped in PHP date() by an \, in jQuery UI DatePicker they are enclosed in '') - this._dateFormat = format.replace(/([^dDjlzFmMnoYyU\\]*(?:\\.[^dDjlzFmMnoYyU\\]*)*)(d|D|j|l|z|F|m|M|n|o|Y|y|U)/g, function(match, part1, part2, offset, string) { + this._dateFormat = format.replace(/([^dDjlzFmMnoYyU\\]*(?:\\.[^dDjlzFmMnoYyU\\]*)*)([dDjlzFmMnoYyU]{1})/g, function(match, part1, part2, offset, string) { $.each(replacementTable, function(key, item) { if(part2 == key) { part2 = item; -- 2.20.1