diff --git a/documentation.md b/documentation.md index 01a2e94..e52da72 100644 --- a/documentation.md +++ b/documentation.md @@ -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`* @@ -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`* diff --git a/src/models/issue.js b/src/models/issue.js index adeed56..0288f3d 100755 --- a/src/models/issue.js +++ b/src/models/issue.js @@ -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; } diff --git a/src/models/mergeRequest.js b/src/models/mergeRequest.js index 5ea2f95..d1c8de0 100755 --- a/src/models/mergeRequest.js +++ b/src/models/mergeRequest.js @@ -1,4 +1,5 @@ const hasTimes = require('./hasTimes'); +const moment = require('moment'); /** * merge request model @@ -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; }