From 1f726311d18449d08a605c461c60964337278914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Srinivas=20=20Thatiparthy=20=28=E0=B0=B6=E0=B1=8D=E0=B0=B0?= =?UTF-8?q?=E0=B1=80=E0=B0=A8=E0=B0=BF=E0=B0=B5=E0=B0=BE=E0=B0=B8=E0=B1=8D?= =?UTF-8?q?=20=20=E0=B0=A4=E0=B0=BE=E0=B0=9F=E0=B0=BF=E0=B0=AA=E0=B0=B0?= =?UTF-8?q?=E0=B1=8D=E0=B0=A4=E0=B0=BF=29?= Date: Sat, 10 Nov 2018 06:26:46 +0530 Subject: [PATCH] Used method chaining in DateTimeShortcuts.js. --- .../admin/static/admin/js/admin/DateTimeShortcuts.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js b/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js index 8b7de5eed7..08b2785c06 100644 --- a/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js +++ b/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js @@ -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();