Skip to content

Commit

Permalink
Used method chaining in DateTimeShortcuts.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy authored and timgraham committed Nov 10, 2018
1 parent 0b98e8f commit 1f72631
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@
handleCalendarCallback: function(num) {
var format = get_format('DATE_INPUT_FORMATS')[0];
// the format needs to be escaped a little
format = format.replace('\\', '\\\\');
format = format.replace('\r', '\\r');
format = format.replace('\n', '\\n');
format = format.replace('\t', '\\t');
format = format.replace("'", "\\'");
format = format.replace('\\', '\\\\')
.replace('\r', '\\r')
.replace('\n', '\\n')
.replace('\t', '\\t')
.replace("'", "\\'");
return function(y, m, d) {
DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format);
DateTimeShortcuts.calendarInputs[num].focus();
Expand Down

0 comments on commit 1f72631

Please sign in to comment.