mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #33784 -- Removed unnecessary format escaping in admin calendar widget.
Replacements were added infa0653cd1dwhere we created a callback function by concatenating strings. It's unnecessary sinced638cdc42a.
This commit is contained in:
@@ -387,13 +387,7 @@
|
|||||||
DateTimeShortcuts.calendars[num].drawNextMonth();
|
DateTimeShortcuts.calendars[num].drawNextMonth();
|
||||||
},
|
},
|
||||||
handleCalendarCallback: function(num) {
|
handleCalendarCallback: function(num) {
|
||||||
let format = get_format('DATE_INPUT_FORMATS')[0];
|
const format = get_format('DATE_INPUT_FORMATS')[0];
|
||||||
// the format needs to be escaped a little
|
|
||||||
format = format.replace('\\', '\\\\')
|
|
||||||
.replace('\r', '\\r')
|
|
||||||
.replace('\n', '\\n')
|
|
||||||
.replace('\t', '\\t')
|
|
||||||
.replace("'", "\\'");
|
|
||||||
return function(y, m, d) {
|
return function(y, m, d) {
|
||||||
DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format);
|
DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format);
|
||||||
DateTimeShortcuts.calendarInputs[num].focus();
|
DateTimeShortcuts.calendarInputs[num].focus();
|
||||||
|
|||||||
Reference in New Issue
Block a user