Skip to content

Commit

Permalink
[jquery-ui] string block is replaced with string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
solomax committed Jul 7, 2024
1 parent dba637d commit 08367ba
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ public void renderHead(Component component, IHeaderResponse response)

// date-format helper
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forScript(
"""
window.WicketStuff = window.WicketStuff || {};
window.WicketStuff.JqueryUI = window.WicketStuff.JqueryUI || {};
window.WicketStuff.JqueryUI.toLocalDateTime = function (d) {
let pad = (n) => ('' + n).padStart(2, '0');
return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate())
+ 'T' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds()) + 'Z';
};"""
"window.WicketStuff = window.WicketStuff || {};\n"
+ "window.WicketStuff.JqueryUI = window.WicketStuff.JqueryUI || {};\n"
+ "window.WicketStuff.JqueryUI.toLocalDateTime = function (d) {\n"
+ "\tlet pad = (n) => ('' + n).padStart(2, '0');\n"
+ "\treturn d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate())\n"
+ "\t\t + 'T' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds()) + 'Z';\n"
+ "};"
, "jquery-ui-date-format-helper")));

/* adds and configure the busy indicator */
Expand Down

0 comments on commit 08367ba

Please sign in to comment.