Skip to content

Commit

Permalink
Add cell ending time as tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Dec 11, 2022
1 parent f63eaa6 commit b9e7873
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class TimerCellStatusBarItem extends Disposable {
const startTime = this._cell.internalMetadata.runStartTime;
const endTime = this._cell.internalMetadata.runEndTime;
if (typeof startTime === 'number' && typeof endTime === 'number') {
item = this._getTimeItem(startTime, endTime);
item = this._getTimeItem(startTime, endTime, undefined, true);
}
}

Expand All @@ -266,12 +266,13 @@ class TimerCellStatusBarItem extends Disposable {
}
}

private _getTimeItem(startTime: number, endTime: number, adjustment: number = 0): INotebookCellStatusBarItem {
private _getTimeItem(startTime: number, endTime: number, adjustment: number = 0, isDone = false): INotebookCellStatusBarItem {
const duration = endTime - startTime + adjustment;
return <INotebookCellStatusBarItem>{
text: formatCellDuration(duration),
alignment: CellStatusbarAlignment.Left,
priority: Number.MAX_SAFE_INTEGER - 1
priority: Number.MAX_SAFE_INTEGER - 1,
tooltip: isDone ? new Date(endTime).toLocaleString() : undefined
};
}

Expand Down

0 comments on commit b9e7873

Please sign in to comment.