If the this._CultureAMPMPlaceholder == "", ConvFmtTime fails when creating a regular expression: Microsoft JScript runtime error: Expected ')' in regular expression
CODE:
-------
, ConvFmtTime : function(input,loadFirst)
{
//.......
var LDLcAM = "";
var LDLcPM = "";
if (this._CultureAMPMPlaceholder != "") //// FALSE so LDLcAM and LDLcPM remains empty
{
LDLcAM = this._CultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[0];
LDLcPM = this._CultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[1];
}
// convert current Culture to user culture format (24H)
if (this.get_UserTimeFormat() == AjaxControlToolkit.MaskedEditUserTimeFormat.TwentyFourHour) //// TRUE
{
input = input.replace(new RegExp("(\\" + LDLcAM + ")", "g"),""); //// RegExp string goes "(\\)" resp. (\), which leads to error
if (input.indexOf(LDLcPM) != -1)
{
AddH = 12;
}
input = input.replace(new RegExp("(\\" + LDLcPM + ")", "g"),"");
}
//.....
}
Comments: Issues is closed as we are not able to reproduce. Please reopen with sample code if someone still getting problem with this issue.
CODE:
-------
, ConvFmtTime : function(input,loadFirst)
{
//.......
var LDLcAM = "";
var LDLcPM = "";
if (this._CultureAMPMPlaceholder != "") //// FALSE so LDLcAM and LDLcPM remains empty
{
LDLcAM = this._CultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[0];
LDLcPM = this._CultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[1];
}
// convert current Culture to user culture format (24H)
if (this.get_UserTimeFormat() == AjaxControlToolkit.MaskedEditUserTimeFormat.TwentyFourHour) //// TRUE
{
input = input.replace(new RegExp("(\\" + LDLcAM + ")", "g"),""); //// RegExp string goes "(\\)" resp. (\), which leads to error
if (input.indexOf(LDLcPM) != -1)
{
AddH = 12;
}
input = input.replace(new RegExp("(\\" + LDLcPM + ")", "g"),"");
}
//.....
}
Comments: Issues is closed as we are not able to reproduce. Please reopen with sample code if someone still getting problem with this issue.