5.0.1
This commit is contained in:
parent
e1dcc51622
commit
9797b474af
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 5.0.1
|
||||||
|
|
||||||
|
- Fix issue where decimal values were not being parsed correctly ([vegeta897](https://github.com/vegeta897))
|
||||||
|
|
||||||
## 5.0.0
|
## 5.0.0
|
||||||
|
|
||||||
- Add `daysPerYear` configuration option
|
- Add `daysPerYear` configuration option
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "timestring",
|
"name": "timestring",
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"description": "Parse a human readable time string into a time based value",
|
"description": "Parse a human readable time string into a time based value",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
6
test.js
6
test.js
@ -92,4 +92,10 @@ describe('timestring', () => {
|
|||||||
it('can parse a messy time string', () => {
|
it('can parse a messy time string', () => {
|
||||||
expect(timestring('5 D a YS 4 h 2 0 mI nS')).to.equal(447600)
|
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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user