Skip to content

Commit

Permalink
Merge ad01e0f into e059f1f
Browse files Browse the repository at this point in the history
  • Loading branch information
olivercoad committed Jun 5, 2019
2 parents e059f1f + ad01e0f commit 95ea2fe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ gtt report --issue_columns=iid --issue_columns=title --issue_columns=time_userna

*Note: Available columns to choose from: `id`, `iid`, `title`, `project_id`,
`project_namespace`, `description`, `labels`, `milestone`, `assignee`, `author`,
`closed`, `updated_at`, `created_at`, `due_date`, `state`, `spent`, `total_spent`, `total_estimate`*
`closed`, `updated_at`, `created_at`, `closed_at`, `due_date`, `state`, `spent`, `total_spent`, `total_estimate`*

*You can also include columns that show the total time spent by a specific user
by following this convention: `time_username`*
Expand All @@ -412,7 +412,7 @@ gtt report --merge_request_columns=iid --merge_request_columns=title --merge_req

*Note: Available columns to choose from: `id`, `iid`, `title`, `project_id`,
`project_namespace`, `description`, `labels`, `milestone`, `assignee`, `author`,
`updated_at`, `created_at`, `state`, `spent`, `total_spent`, `total_estimate`*
`updated_at`, `created_at`, `closed_at`, `merged_at`, `state`, `spent`, `total_spent`, `total_estimate`*

*You can also include columns that show the total time spent by a specific user
by following this convention: `time_username`*
Expand Down
4 changes: 4 additions & 0 deletions src/models/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class issue extends hasTimes {
return this.data.due_date ? moment(this.data.due_date): null;
}

get closed_at() {
return this.data.closed_at ? moment(this.data.closed_at): null;
}

get total_spent() {
return this.stats ? this.config.toHumanReadable(this.stats.total_time_spent, this._type) : null;
}
Expand Down
9 changes: 9 additions & 0 deletions src/models/mergeRequest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const hasTimes = require('./hasTimes');
const moment = require('moment');

/**
* merge request model
Expand Down Expand Up @@ -75,6 +76,14 @@ class mergeRequest extends hasTimes {
return moment(this.data.created_at);
}

get merged_at() {
return this.data.merged_at ? moment(this.data.merged_at): null;
}

get closed_at() {
return this.data.closed_at ? moment(this.data.closed_at): "not closed"
}

get state() {
return this.data.state;
}
Expand Down

0 comments on commit 95ea2fe

Please sign in to comment.