Skip to content

Commit

Permalink
[bugfix] Avoid using trim() (moment#4564)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashsearle authored and Cyril Martin committed Jun 1, 2018
1 parent 3062ca1 commit 00f97e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/create/from-string.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 00f97e2

Please sign in to comment.