fixed mistakes

This commit is contained in:
Mike Barrett 2012-12-22 17:17:43 +00:00
parent e28eb0f09f
commit 473eadc8d7

View File

@ -121,7 +121,7 @@ var time = str.parseTime('h', settings);
var time = (new Timestring(settings)).parse(str, 'h');
console.log(time) // will log 1
console.log(time); // will log 1
```
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.
@ -138,7 +138,7 @@ var settings = {
// get time values from form input
var today = document.querySelector('time-input').value, // '1d'
thisWeek = document.querySelector('time-input').value // '1w';
thisWeek = document.querySelector('time-input').value; // '1w'
// parse times
var hoursToday = today.parseTime('h', settings),
@ -147,9 +147,9 @@ var hoursToday = today.parseTime('h', settings),
// or
var hoursToday = (new Timestring(settings)).parse(today, 'h'),
daysThisWeek = (new Timestring(settings)).parse(thisWeek, 'd')
daysThisWeek = (new Timestring(settings)).parse(thisWeek, 'd');
console.log(hoursToday) // will log 7.5
console.log(daysThisWeek) // will log 5
console.log(hoursToday); // will log 7.5
console.log(daysThisWeek); // will log 5
```