Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@naturalcycles/time-lib

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naturalcycles/time-lib - npm Package Compare versions

Comparing version 1.6.6 to 1.6.7

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.6.7](https://github.com/NaturalCycles/time-lib/compare/v1.6.6...v1.6.7) (2019-11-14)
### Bug Fixes
* ms returning 1h59m instead of 59m ([970cba5](https://github.com/NaturalCycles/time-lib/commit/970cba503bd347fa598748e140f1a3e0ad6abe78))
## [1.6.6](https://github.com/NaturalCycles/time-lib/compare/v1.6.5...v1.6.6) (2019-11-11)

@@ -2,0 +9,0 @@

15

dist-esm/time.util.js

@@ -24,11 +24,12 @@ export const TS_2018_06_21 = 1529539200;

return `${(millis / 1000).toFixed(3)} sec`;
// <1 min
if (millis < 60 * 1000)
return `${Math.round(millis / 1000)} sec`;
const sec = Math.round(millis / 1000) % 60;
const min = Math.round(millis / (60 * 1000)) % 60;
const hrs = Math.round(millis / (3600 * 1000));
const sec = Math.floor(millis / 1000) % 60;
const min = Math.floor(millis / (60 * 1000)) % 60;
const hrs = Math.floor(millis / (3600 * 1000));
// <1 hr
if (hrs === 0)
if (hrs === 0) {
// <1 min
if (min === 0)
return `${sec} sec`;
return `${min}m${sec}s`;
}
// >= 1hr

@@ -35,0 +36,0 @@ return `${hrs}h${min}m${sec}s`;

@@ -27,11 +27,12 @@ "use strict";

return `${(millis / 1000).toFixed(3)} sec`;
// <1 min
if (millis < 60 * 1000)
return `${Math.round(millis / 1000)} sec`;
const sec = Math.round(millis / 1000) % 60;
const min = Math.round(millis / (60 * 1000)) % 60;
const hrs = Math.round(millis / (3600 * 1000));
const sec = Math.floor(millis / 1000) % 60;
const min = Math.floor(millis / (60 * 1000)) % 60;
const hrs = Math.floor(millis / (3600 * 1000));
// <1 hr
if (hrs === 0)
if (hrs === 0) {
// <1 min
if (min === 0)
return `${sec} sec`;
return `${min}m${sec}s`;
}
// >= 1hr

@@ -38,0 +39,0 @@ return `${hrs}h${min}m${sec}s`;

@@ -42,3 +42,3 @@ {

},
"version": "1.6.6",
"version": "1.6.7",
"description": "Date/time related API, based on DayJS",

@@ -45,0 +45,0 @@ "keywords": [

@@ -26,14 +26,16 @@ export const TS_2018_06_21 = 1529539200

// <1 min
if (millis < 60 * 1000) return `${Math.round(millis / 1000)} sec`
const sec = Math.floor(millis / 1000) % 60
const min = Math.floor(millis / (60 * 1000)) % 60
const hrs = Math.floor(millis / (3600 * 1000))
const sec = Math.round(millis / 1000) % 60
const min = Math.round(millis / (60 * 1000)) % 60
const hrs = Math.round(millis / (3600 * 1000))
// <1 hr
if (hrs === 0) return `${min}m${sec}s`
if (hrs === 0) {
// <1 min
if (min === 0) return `${sec} sec`
return `${min}m${sec}s`
}
// >= 1hr
return `${hrs}h${min}m${sec}s`
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc