Used method chaining in DateTimeShortcuts.js.
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();
