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

humanize-duration

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

humanize-duration - npm Package Compare versions

Comparing version 3.15.0 to 3.15.1

5

HISTORY.md

@@ -0,1 +1,6 @@

3.15.1 / 2018-07-15
===================
* fix: corrections for Croatian
3.15.0 / 2018-06-12

@@ -2,0 +7,0 @@ ===================

9

humanize-duration.js

@@ -168,5 +168,4 @@ // HumanizeDuration.js - https://git.io/j0HgmQ

m: function (c) {
if (c === 12 || c === 13 || c === 14) {
return 'minuta'
} else if (c % 10 === 2 || c % 10 === 3 || c % 10 === 4) {
var mod10 = c % 10
if ((mod10 === 2 || mod10 === 3 || mod10 === 4) && (c < 10 || c > 14)) {
return 'minute'

@@ -177,3 +176,5 @@ }

s: function (c) {
if (c === 1) {
if ((c === 10 || c === 11 || c === 12 || c === 13 || c === 14 || c === 16 || c === 17 || c === 18 || c === 19) || (c % 10 === 5)) {
return 'sekundi'
} else if (c % 10 === 1) {
return 'sekunda'

@@ -180,0 +181,0 @@ } else if (c % 10 === 2 || c % 10 === 3 || c % 10 === 4) {

@@ -28,3 +28,3 @@ {

],
"version": "3.15.0",
"version": "3.15.1",
"description": "Convert millisecond durations to English and many other languages.",

@@ -31,0 +31,0 @@ "homepage": "https://github.com/EvanHahn/HumanizeDuration.js",

@@ -9,3 +9,3 @@ Humanize Duration

**This library is in maintenance mode. New languages and bug fixes will be added but no new features will be. If you're interested in helping out by taking over the project, please see [this GitHub issue](https://github.com/EvanHahn/HumanizeDuration.js/issues/120).**
**This library is actively maintained but no new features will be added.**

@@ -17,4 +17,11 @@ Basic usage

In the browser:
With `require` (like in Node or with common build systems):
```js
const humanizeDuration = require('humanize-duration')
humanizeDuration(12000) // '12 seconds'
```
With a `<script>` tag:
```html

@@ -27,9 +34,2 @@ <script src="humanize-duration.js"></script>

In Node (or Browserify or Webpack or anywhere with CommonJS):
```js
var humanizeDuration = require('humanize-duration')
humanizeDuration(12000) // '12 seconds'
```
Usage

@@ -158,3 +158,3 @@ -----

```js
var spanishHumanizer = humanizeDuration.humanizer({
const spanishHumanizer = humanizeDuration.humanizer({
language: 'es',

@@ -171,14 +171,14 @@ units: ['y', 'mo', 'd']

```js
var shortEnglishHumanizer = humanizeDuration.humanizer({
const shortEnglishHumanizer = humanizeDuration.humanizer({
language: 'shortEn',
languages: {
shortEn: {
y: function() { return 'y' },
mo: function() { return 'mo' },
w: function() { return 'w' },
d: function() { return 'd' },
h: function() { return 'h' },
m: function() { return 'm' },
s: function() { return 's' },
ms: function() { return 'ms' },
y: () => 'y',
mo: () => 'mo',
w: () => 'w',
d: () => 'd',
h: () => 'h',
m: () => 'm',
s: () => 's',
ms: () => 'ms',
}

@@ -194,6 +194,6 @@ }

```js
var humanizer = humanizeDuration.humanizer()
const humanizer = humanizeDuration.humanizer()
humanizer.languages.shortEn = {
y: function(c) { return c + 'y' },
y: () => 'y',
// ...

@@ -294,1 +294,2 @@ ```

* [aurelia-time](https://github.com/shahabganji/aurelia-time)
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