timestring.js attempts to parse a human readable time string into a time based value.
##Overview
```js
var str = '1h 15m';
var time = str.parseTime();
console.log(time); // will log 4500
```
In the example above `str` is just a plain old `String` object. timestring.js adds a new method to the `String` objects prototype named `parseTime`. This method parses the string and returns a time based value.
**By default the returned time value will be in seconds.**
The time string can contain as many time groups as needed:
```js
var str = '1d 3h 25m 18s';
var time = str.parseTime();
console.log(time); // will log 98718
```
and can be as messy as you like:
```js
var str = '1 d 3h 25 m 1 8s';
var time = str.parseTime();
console.log(time); // will log 98718
```
As well as using the `String` objects `parseTime` method you can create a `Timestring` object and parse the string manually:
```js
var str = '1h 15m';
var time = (new Timestring()).parse(str);
console.log(time); // will log 4500
```
##Keywords
timestring.js will parse the following keywords into time values:
1.`s, sec, secs, second, seconds` - will parse to seconds
2.`m, min, mins, minute, minutes` - will parse to minutes
By default the return time value will be in seconds. This can be changed by passing one of the following strings as an argument to `String.parseTime` or `Timestring.parse`:
1.`s` - Seconds
2.`m` - Minutes
3.`h` - Hours
4.`d` - Days
5.`w` - Weeks
6.`mth` - Months
7.`y` - Years
```js
var str = '22h 16m';
var hours = str.parseTime('h'); // 22.266666666666666
var days = str.parseTime('d'); // 0.9277777777777778
var weeks = str.parseTime('w'); // 0.13253968253968254
In the example of above `hoursPerDay` is being set to `1`. When the time string is being parsed, the return value is being specified as hours. Normally `1d` would parse to `24` hours (as by deafult there are 24 hours in a day) but because `hoursPerDay` has been set to `1`, `1d` will now only parse to `1` hour.
*Example - Employees of my company work 7.5 hours a day, and only work 5 days a week. In my time tracking app, when they type `1d` i want 7.5 hours to be tracked. When they type `1w` i want 5 days to be tracked etc.*