From 5bc78c8c9f38fbb516e9e9f2f8a633b9b3b90a6f Mon Sep 17 00:00:00 2001 From: Melloware Date: Sat, 25 Apr 2020 13:56:50 -0400 Subject: [PATCH] Inversed call to trim() --- jquery.timeago.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index 7b884f2f..79dce4d1 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -113,11 +113,11 @@ var separator = $l.wordSeparator || ""; if ($l.wordSeparator === undefined) { separator = " "; } - return String.prototype.trim.call([prefix, words, suffix].join(separator)); + return [prefix, words, suffix].join(separator).trim(); }, parse: function(iso8601) { - var s = String.prototype.trim.call(iso8601); + var s = iso8601.trim(); s = s.replace(/\.\d+/,""); // remove milliseconds s = s.replace(/-/,"/").replace(/-/,"/"); s = s.replace(/T/," ").replace(/Z/," UTC"); @@ -208,7 +208,7 @@ element = $(element); if (!element.data("timeago")) { element.data("timeago", { datetime: $t.datetime(element) }); - var text = String.prototype.trim.call(element.text()); + var text = element.text().trim(); if ($t.settings.localeTitle) { element.attr("title", element.data('timeago').datetime.toLocaleString()); } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {