Skip to content
This repository has been archived by the owner on Jan 12, 2020. It is now read-only.

Commit

Permalink
Bye bye hours
Browse files Browse the repository at this point in the history
  • Loading branch information
paazmaya committed Jul 24, 2013
1 parent c5063a3 commit f32fbb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -48,7 +48,7 @@ Current values shown are the defaults.
height: 600,
datemin: '', // yyyy-mm-dd, if left empty, will use all available time
datemax: '', // yyyy-mm-dd
interval: '3m', // int followed by: y = years, m = months, w = weeks, d = days, h = hours
interval: '3m', // int followed by: y = years, m = months, w = weeks, d = days
iterations: 4, // number of iterations the interval should be useds
uselines: true,
showtags: false,
Expand Down Expand Up @@ -126,7 +126,8 @@ grunt hgactivity:yearly

## Changelog

* 2013-07-23 v0.1.0 Initial release
* 2013-07-24 v0.1.1 Removed 'hours' time span option
* 2013-07-23 v0.1.0 Initial release


## License
Expand Down
13 changes: 7 additions & 6 deletions tasks/hgactivity.js
Expand Up @@ -26,7 +26,7 @@ module.exports = function(grunt) {
height: 600,
datemin: '', // yyyy-mm-dd, if left empty, will use all available time
datemax: '', // yyyy-mm-dd
interval: '3m', // int followed by: y = years, m = months, w = weeks, d = days, h = hours
interval: '3m', // int followed by: y = years, m = months, w = weeks, d = days
iterations: 4, // number of iterations the interval should be useds
uselines: true,
showtags: false,
Expand All @@ -39,8 +39,7 @@ module.exports = function(grunt) {
y: 'years',
m: 'months', // default
w: 'weeks',
d: 'days',
h: 'hours'
d: 'days'
};

// Options that can be used as such and prepended with --
Expand Down Expand Up @@ -103,11 +102,13 @@ module.exports = function(grunt) {
// Need at least one pair of dates
if (dates.length > 1) {
for (var i = 0; i < dates.length - 1; i++) {
var startDate = dates[i + 1]; // TODO: add a day to avoid overlapping
var endDate = dates[i];
commands.push(args.concat(
'--split', split,
'--datemin', dates[i + 1], '--datemax', dates[i],
'--filename', (filename + '_' + dates[i + 1] + '_' + dates[i] + '.png'),
'--imagetitle', ('"' + title + ': ' + dates[i + 1] + ' - ' + dates[i] + '"')
'--datemin', startDate, '--datemax', endDate,
'--filename', (filename + '_' + startDate + '_' + endDate + '.png'),
'--imagetitle', ('"' + title + ': ' + startDate + ' - ' + endDate + '"')
));
}
}
Expand Down

0 comments on commit f32fbb7

Please sign in to comment.