Skip to content

Commit

Permalink
fixed another issue on client-side date deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschwarz committed Dec 21, 2021
1 parent eb9cf95 commit aa9b7a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AjaxPro/Utilities/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public sealed class Constant
/// <summary>
/// The assembly version.
/// </summary>
public const string AssemblyVersion = "21.12.21.1";
public const string AssemblyVersion = "21.12.21.2";
}
}
7 changes: 6 additions & 1 deletion AjaxPro/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,19 @@ Object.extend(AjaxPro, {
if (matches.length == 7) {
matches[1] = (parseInt(matches[1], 0) - 1).toString();
var isDate = true;
var s = "";
for (var i = 0; i < matches.length; i++) {
if (isNaN(parseInt(matches[i], 10))) {
isDate = false;
break;
}
if (i > 0) {
s += ",";
}
s += parseInt(matches[i], 10);
}
if (isDate) {
return "new Date(Date.UTC(" + matches.join(",") + "))";
return "new Date(Date.UTC(" + s + "))";
}
}
}
Expand Down

0 comments on commit aa9b7a3

Please # to comment.