Skip to content

Commit

Permalink
prior time whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
aramok committed Oct 20, 2019
1 parent 9068745 commit 6a0978f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "aramoks-clearcase",
"displayName": "Aramok's Clearcase",
"description": "IBM Rational Clearcase integration with Visual Studio Code",
"version": "1.0.16",
"version": "1.0.18",
"author": {
"name": "Sencer Aramok",
"email": "mohorame@gmail.com"
Expand Down
18 changes: 9 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ function cleartoolDescribeRealFile(realFilePath: String) {
if (stdout.indexOf("CHECKEDOUT") !== -1) {
setContextCriteria(FileState.CheckedOut);

fileStatus.text = `$(git-branch) ` + stdout.match(/(?<=by\s).*(?=\s)/) + datePriorToNowRexExp(stdout.match(/(?<=checked out\s)(\S)*/));
fileStatus.text = `$(history) ` + stdout.match(/(?<=\()\S*(?=\.)/) + datePriorToNowRexExp(stdout.match(/(?<=checked out\s)(\S)*/));
fileState.text = `$(verified) Checked Out`;
} else {
setContextCriteria(FileState.Locked);
fileStatus.text = `$(git-branch) ` + stdout.match(/(?<=by\s).*(?=\s)/) + datePriorToNowRexExp(stdout.match(/(?<=created\s)(\S)*(?=,|\+)/));
fileStatus.text = `$(history) ` + stdout.match(/(?<=\()\S*(?=\.)/) + datePriorToNowRexExp(stdout.match(/(?<=created\s)(\S)*(?=,|\+)/));
fileState.text = `$(lock) Locked`;
}
} else {
setContextCriteria(FileState.Private);
viewStatus.text = `$(git-branch) No Version`;
fileStatus.text = `$(git-branch) ` + stdout.match(/(?<=by\s).*(?=\s)/) + datePriorToNowRexExp(stdout.match(/(?<=Modified:\s).*/));
fileStatus.text = `$(history) ` + stdout.match(/(?<=\()\S*(?=\.)/) + datePriorToNowRexExp(stdout.match(/(?<=Modified:\s).*/));
fileState.text = `$(file-code) Private File`;
}
});
Expand Down Expand Up @@ -222,17 +222,17 @@ function datePriorToNow(now: Date): string {
var msPerMonth = msPerDay * 30;
var msPerYear = msPerDay * 365;
if (dateTime < msPerMinute) {
return Math.round(dateTime / 1000) + ' seconds ago';
return ' ' + Math.round(dateTime / 1000) + ' seconds ago';
} else if (dateTime < msPerHour) {
return Math.round(dateTime / msPerMinute) + ' minutes ago';
return ' ' + Math.round(dateTime / msPerMinute) + ' minutes ago';
} else if (dateTime < msPerDay) {
return Math.round(dateTime / msPerHour) + ' hours ago';
return ' ' + Math.round(dateTime / msPerHour) + ' hours ago';
} else if (dateTime < msPerMonth) {
return '~' + Math.round(dateTime / msPerDay) + ' days ago';
return ' ~' + Math.round(dateTime / msPerDay) + ' days ago';
} else if (dateTime < msPerYear) {
return '~' + Math.round(dateTime / msPerMonth) + ' months ago';
return ' ~' + Math.round(dateTime / msPerMonth) + ' months ago';
} else {
return '~' + Math.round(dateTime / msPerYear) + ' years ago';
return ' ~' + Math.round(dateTime / msPerYear) + ' years ago';
}
}

Expand Down

0 comments on commit 6a0978f

Please sign in to comment.