diff --git a/schema/settings.json b/schema/settings.json index a712af2..675150f 100644 --- a/schema/settings.json +++ b/schema/settings.json @@ -41,6 +41,12 @@ "description": "Show the current execution time (last execution time) as a cell executes.", "default": true }, + "showDate": { + "type": "boolean", + "title": "Show Last Execution Date", + "description": "Show the date of last cell execution.", + "default": true + }, "historyCount": { "type": "number", "title": "History of Cell Execution Time", diff --git a/src/ExecuteTimeWidget.ts b/src/ExecuteTimeWidget.ts index 27df3a8..d17d254 100644 --- a/src/ExecuteTimeWidget.ts +++ b/src/ExecuteTimeWidget.ts @@ -29,6 +29,7 @@ export interface IExecuteTimeSettings { minTime: number; textContrast: string; showLiveExecutionTime: boolean; + showDate: boolean; historyCount: number; dateFormat: string; } @@ -276,6 +277,11 @@ export default class ExecuteTimeWidget extends Widget { endTime, this._settings.dateFormat )} in ${executionTime}`; + msg = 'Last executed'; + if (this._settings.showDate) { + msg += ` at ${getTimeString(endTime, this._settings.dateFormat)}`; + } + msg += ` in ${executionTime}`; } } else if (startTime) { if (this._settings.showLiveExecutionTime) { @@ -353,6 +359,7 @@ export default class ExecuteTimeWidget extends Widget { .composite as string; this._settings.showLiveExecutionTime = settings.get('showLiveExecutionTime') .composite as boolean; + this._settings.showDate = settings.get('showDate').composite as boolean; this._settings.historyCount = settings.get('historyCount') .composite as number; @@ -397,6 +404,7 @@ export default class ExecuteTimeWidget extends Widget { minTime: 0, textContrast: 'high', showLiveExecutionTime: true, + showDate: true, historyCount: 5, dateFormat: 'yyy-MM-dd HH:mm:ss', };