diff --git a/.eslintrc b/.eslintrc index 59b66f6a247..ff7610fd2c5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,7 +16,7 @@ "no-alert": [0], "no-eval": [1], "no-extend-native": [2, {"exceptions": ["Date", "String"]}], - "no-multi-spaces": [1], + "no-multi-spaces": [2], "no-octal-escape": [1], "no-underscore-dangle": [1], "no-unused-vars": [2, {"vars": "local", "args": "none"}], diff --git a/django/contrib/admin/static/admin/js/timeparse.js b/django/contrib/admin/static/admin/js/timeparse.js index 50747c81998..15dc13956f1 100644 --- a/django/contrib/admin/static/admin/js/timeparse.js +++ b/django/contrib/admin/static/admin/js/timeparse.js @@ -1,6 +1,7 @@ var timeParsePatterns = [ // 9 - { re: /^\d{1,2}$/i, + { + re: /^\d{1,2}$/i, handler: function(bits) { if (bits[0].length === 1) { return '0' + bits[0] + ':00'; @@ -10,19 +11,22 @@ var timeParsePatterns = [ } }, // 13:00 - { re: /^\d{2}[:.]\d{2}$/i, + { + re: /^\d{2}[:.]\d{2}$/i, handler: function(bits) { return bits[0].replace('.', ':'); } }, // 9:00 - { re: /^\d[:.]\d{2}$/i, + { + re: /^\d[:.]\d{2}$/i, handler: function(bits) { return '0' + bits[0].replace('.', ':'); } }, // 3 am / 3 a.m. / 3am - { re: /^(\d+)\s*([ap])(?:.?m.?)?$/i, + { + re: /^(\d+)\s*([ap])(?:.?m.?)?$/i, handler: function(bits) { var hour = parseInt(bits[1]); if (hour === 12) { @@ -43,7 +47,8 @@ var timeParsePatterns = [ } }, // 3.30 am / 3:15 a.m. / 3.00am - { re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i, + { + re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i, handler: function(bits) { var hour = parseInt(bits[1]); var mins = parseInt(bits[2]); @@ -68,13 +73,15 @@ var timeParsePatterns = [ } }, // noon - { re: /^no/i, + { + re: /^no/i, handler: function(bits) { return '12:00'; } }, // midnight - { re: /^mid/i, + { + re: /^mid/i, handler: function(bits) { return '00:00'; }