0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Used method chaining in DateTimeShortcuts.js.

This commit is contained in:
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) 2018-11-10 06:26:46 +05:30 committed by Tim Graham
parent 0b98e8fdad
commit 1f726311d1

View File

@ -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();