dry-underscore
Advanced tools
Comparing version 0.8.8 to 0.8.9
@@ -56,2 +56,16 @@ "use strict"; | ||
_.seconds = function(n){ | ||
if(n === undefined){ return(0); } | ||
else{ return(n); } | ||
}; | ||
_.seconds.durationString = function(secs){ | ||
var minutes = Math.floor(secs / 60); | ||
secs = secs % 60; | ||
var str = _.minutes.durationString(minutes); | ||
if(secs < 10){ secs = "0" + secs; } | ||
str = str + ":" + secs; | ||
return(str); | ||
}; | ||
_.minutes = function(n){ | ||
@@ -73,2 +87,11 @@ if(n === undefined){ return(0); } | ||
}; | ||
_.minutes.durationString = function(min){ | ||
var hours = Math.floor(min / 60); | ||
var minutes = min % 60; | ||
if(minutes < 10){ | ||
minutes = "0" + minutes; | ||
} | ||
return(hours + ":" + minutes); | ||
}; | ||
_.minutes.timeString = function(min){ | ||
@@ -75,0 +98,0 @@ var hours = Math.floor(min / 60); |
{ | ||
"name": "dry-underscore", | ||
"version": "0.8.8", | ||
"version": "0.8.9", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "formidable": { |
{ | ||
"name": "dry-underscore", | ||
"version": "0.8.8", | ||
"version": "0.8.9", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "The DRY Undescore Library", |
@@ -35,2 +35,3 @@ "use strict"; | ||
exports.testEach = testEach; | ||
exports.testSeconds = testSeconds; | ||
//exports.hashTest = hashTest; | ||
@@ -47,2 +48,10 @@ //exports.testFatal = testFatal; | ||
function testSeconds(){ | ||
eq("0:00:01", _.seconds.durationString(1)); | ||
eq("0:01:01", _.seconds.durationString(61)); | ||
eq("1:01:01", _.seconds.durationString(3661)); | ||
} | ||
function testEach(){ | ||
@@ -49,0 +58,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1586193
14534