From 3751418fa2b58615e7bbc41c5ac4540bcb51badc Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Fri, 21 Jan 2011 09:36:21 -0800 Subject: [PATCH] Making all if statements have the curly braces. --- jquery.timeago.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index 8befb46..1b3e5f3 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -15,9 +15,13 @@ */ (function($) { $.timeago = function(timestamp) { - if (timestamp instanceof Date) return inWords(timestamp); - else if (typeof timestamp === "string") return inWords($.timeago.parse(timestamp)); - else return inWords($.timeago.datetime(timestamp)); + if (timestamp instanceof Date) { + return inWords(timestamp); + } else if (typeof timestamp === "string") { + return inWords($.timeago.parse(timestamp)); + } else { + return inWords($.timeago.datetime(timestamp)); + } }; var $t = $.timeago; @@ -122,7 +126,9 @@ if (!element.data("timeago")) { element.data("timeago", { datetime: $t.datetime(element) }); var text = $.trim(element.text()); - if (text.length > 0) element.attr("title", text); + if (text.length > 0) { + element.attr("title", text); + } } return element.data("timeago"); }