jkroso / parse-duration

convert a human readable duration to ms
MIT License
243 stars 37 forks source link

Support singular form without integer #2

Closed Jokero closed 8 years ago

Jokero commented 8 years ago

Now I can use multiple ways to get number of milliseconds for singular forms of string:

parse('1h') // 3600000
parse('1 h') // 3600000
parse('1hour') // 3600000
parse('1 hour') // 3600000
parse('1hours') // 3600000
parse('1 hours') // 3600000
// ...

But I can't do in the following way without integer:

parse('h') // 0, should be 3600000
parse('hour') // 0, should be 3600000