Skip to content

Commit 46ce4cc

Browse files
committed
feature(report): allow use of --last_month when generating reports
1 parent 5dc3904 commit 46ce4cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gtt-report.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ program
4242
.option('--today', 'ignores --from and --to and queries entries for today')
4343
.option('--this_week', 'ignores --from and --to and queries entries for this week')
4444
.option('--this_month', 'ignores --from and --to and queries entries for this month')
45+
.option('--last_month', 'ignores --from and --to and queries entries for last month')
4546
.option('-c --closed', 'include closed issues')
4647
.option('-m --milestone <milestone>', 'include issues from the given milestone')
4748
.option('--hours_per_day <hours>', 'hours per day for human readable time formats')
@@ -168,6 +169,10 @@ if (program.opts().this_month)
168169
config
169170
.set('from', moment().startOf('month'))
170171
.set('to', moment().endOf('month'));
172+
if (program.opts().last_month)
173+
config
174+
.set('from', moment().subtract(1, 'months').startOf('month'))
175+
.set('to', moment().subtract(1, 'months').endOf('month'));
171176

172177
Cli.quiet = config.get('quiet');
173178
Cli.verbose = config.get('_verbose');

0 commit comments

Comments
 (0)