lib/resque/server/public/jquery.relatize_date.js in resque-1.23.0 vs lib/resque/server/public/jquery.relatize_date.js in resque-1.23.1
- old
+ new
@@ -65,24 +65,24 @@
* @param {Date} fromTime The start date to use in the calculation
* @param {Date} toTime The end date to use in the calculation
* @param {Boolean} Include the time in the output
*/
distanceOfTimeInWords: function(fromTime, toTime, includeTime) {
- var delta = parseInt((toTime.getTime() - fromTime.getTime()) / 1000);
+ var delta = parseInt((toTime.getTime() - fromTime.getTime()) / 1000, 10);
if (delta < 60) {
return 'just now';
} else if (delta < 120) {
return 'about a minute ago';
} else if (delta < (45*60)) {
- return (parseInt(delta / 60)).toString() + ' minutes ago';
+ return (parseInt(delta / 60, 10)).toString() + ' minutes ago';
} else if (delta < (120*60)) {
return 'about an hour ago';
} else if (delta < (24*60*60)) {
- return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
+ return 'about ' + (parseInt(delta / 3600, 10)).toString() + ' hours ago';
} else if (delta < (48*60*60)) {
return '1 day ago';
} else {
- var days = (parseInt(delta / 86400)).toString();
+ var days = (parseInt(delta / 86400, 10)).toString();
if (days > 5) {
var fmt = '%B %d, %Y'
if (includeTime) fmt += ' %I:%M %p'
return $r.strftime(fromTime, fmt);
} else {