From: Daniel Rudolf Date: Thu, 24 Jan 2013 14:23:53 +0000 (+0100) Subject: optimizing date format converter regex X-Git-Tag: 2.0.0_Beta_1~525^2~3^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0cabdb11b9573f3957adb951e53a46f260ceef00;p=GitHub%2FWoltLab%2FWCF.git optimizing date format converter regex --- 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;