Skip to content

Commit

Permalink
Document custom headers for jira ls
Browse files Browse the repository at this point in the history
Closes #87
  • Loading branch information
edeweerd1A authored and germanrcuriel committed Mar 30, 2020
1 parent bb6487d commit 5755fa4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/jira/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ define([
}
if (valueSpec.isDate) {
value = that.formatDate(value); // supports null values
} else if (valueSpec.isDuration) {
value = that.formatDuration(value); // supports null values
}
if (!value && valueSpec.defaultValue) {
value = valueSpec.defaultValue;
Expand All @@ -88,7 +90,7 @@ define([
if(!value){
value="";
}
row.push(value);
row.push(value);
});
that.table.push(row);
}
Expand All @@ -105,6 +107,16 @@ define([
},

formatDate: function (value) {
if (!value) {
return '';
}
return new Date(value).toISOString()
.replace(/T/, ' ')
.replace(/:..\..+$/, '')
.replace(/-/g, '/');
},

formatDuration: function (value) {
if (!value) {
return '0d';
}
Expand Down

0 comments on commit 5755fa4

Please sign in to comment.