Skip to content

Commit

Permalink
5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mike182uk committed May 18, 2018
1 parent e1dcc51 commit 9797b47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})

0 comments on commit 9797b47

Please sign in to comment.