From 9797b474af6e106a63ec26f4b597a56cadfb0aa6 Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Fri, 18 May 2018 09:29:25 +0100 Subject: [PATCH] 5.0.1 --- CHANGELOG.md | 4 ++++ package.json | 2 +- test.js | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f288ddd..52ce85d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 5.0.1 + +- Fix issue where decimal values were not being parsed correctly ([vegeta897](https://github.com/vegeta897)) + ## 5.0.0 - Add `daysPerYear` configuration option diff --git a/package.json b/package.json index 5cf82c5..c07c43d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timestring", - "version": "5.0.0", + "version": "5.0.1", "description": "Parse a human readable time string into a time based value", "main": "index.js", "scripts": { diff --git a/test.js b/test.js index 7536548..7ae84f0 100644 --- a/test.js +++ b/test.js @@ -92,4 +92,10 @@ describe('timestring', () => { it('can parse a messy time string', () => { expect(timestring('5 D a YS 4 h 2 0 mI nS')).to.equal(447600) }) + + it('can parse a time string containing a decimal value', () => { + expect(timestring('1.5 hours')).to.equal(5400) + expect(timestring('2.75 mins')).to.equal(165) + expect(timestring('1.5 w')).to.equal(907200) + }) })