From b4bb926c0cecafd909f6ea9d16b07b75b3461d34 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 27 May 2012 16:53:23 +0200 Subject: [PATCH] move Ox.parseDuration to String.js --- source/Ox/js/Format.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index 2ada6212..e068a108 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -681,20 +681,3 @@ Ox.formatValue = function(number, string, bin) { }); return ret; }; - -/*@ -Ox.parseDuration Takes a formatted duration, returns seconds - > Ox.parseDuration('01:02:03') - 3723 - > Ox.parseDuration('3') - 3 - > Ox.parseDuration('2:') - 120 - > Ox.parseDuration('1::') - 3600 -@*/ -Ox.parseDuration = function(string) { - return string.split(':').reverse().slice(0, 3).reduce(function(p, c, i) { - return p + (parseFloat(c) || 0) * Math.pow(60, i); - }, 0); -};