Comparing version 1.0.4 to 1.0.5
export declare const timerCalc: { | ||
countDownTo: (time: number, timeNow?: number) => string; | ||
currentTime: () => number; | ||
@@ -3,0 +4,0 @@ getLastFullHour: (time?: number) => number; |
@@ -44,3 +44,19 @@ "use strict"; | ||
}; | ||
var countDownTo = function (time, timeNow) { | ||
if (timeNow === void 0) { timeNow = currentTime(); } | ||
// , timeNow = this.currentTime() | ||
var timeLeft = time - timeNow; | ||
if (timeLeft > 0) { | ||
var minutes = Math.floor(timeLeft / 60); | ||
var seconds = timeLeft % 60; | ||
var showM = minutes < 10 ? "0".concat(minutes) : minutes; | ||
var showS = seconds < 10 ? "0".concat(seconds) : seconds; | ||
return "".concat(showM, ":").concat(showS); | ||
} | ||
else { | ||
return "00:00"; | ||
} | ||
}; | ||
exports.timerCalc = { | ||
countDownTo: countDownTo, | ||
currentTime: currentTime, | ||
@@ -47,0 +63,0 @@ getLastFullHour: getLastFullHour, |
{ | ||
"name": "@xxskyy/zh", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
13770
256