From a831fc7e2694281ce31e4f090bbcf90a690f0277 Mon Sep 17 00:00:00 2001 From: Ash Date: Fri, 1 Jun 2018 06:40:30 +0100 Subject: [PATCH] [bugfix] Avoid using trim() (#4564) --- src/lib/create/from-string.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/create/from-string.js b/src/lib/create/from-string.js index 7c1052a3e4..c5ad56bab8 100644 --- a/src/lib/create/from-string.js +++ b/src/lib/create/from-string.js @@ -128,7 +128,7 @@ function untruncateYear(yearStr) { function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space - return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim(); + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) {