Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ There are some quick shorthands:
gtt report --today
gtt report --this_week
gtt report --this_month
gtt report --last_month
```

#### Include closed issues/merge requests
Expand Down
7 changes: 6 additions & 1 deletion src/gtt-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ program
.option('--today', 'ignores --from and --to and queries entries for today')
.option('--this_week', 'ignores --from and --to and queries entries for this week')
.option('--this_month', 'ignores --from and --to and queries entries for this month')
.option('--last_month', 'ignores --from and --to and queries entries for last month')
.option('-c --closed', 'include closed issues')
.option('-u --user <user>', 'only query times from the given user')
.option('-m --milestone <milestone>', 'include issues from the given milestone')
Expand Down Expand Up @@ -132,6 +133,10 @@ if (program.this_month)
config
.set('from', moment().startOf('month'))
.set('to', moment().endOf('month'));
if (program.last_month)
config
.set('from', moment().subtract(1, 'month').startOf('month'))
.set('to', moment().subtract(1, 'month').endOf('month'));

Cli.quiet = config.get('quiet');
Cli.verbose = config.get('_verbose');
Expand Down Expand Up @@ -346,4 +351,4 @@ new Promise(resolve => {
.then(() => Cli.mark())

// time for a beer
.then(() => Cli.done());
.then(() => Cli.done());