Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .vscode/temp.sql
Empty file.
5 changes: 3 additions & 2 deletions clockstatusbaritem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class StatusBarItem {
this._statusBarItem.tooltip = 'Click to insert into selection';
this._statusBarItem.show();

this._interval = setInterval(() => this.refreshUI(), 1000);
this._refresh = vscode.workspace.getConfiguration('clock').refreshInterval * 1000 || 1000;
this._interval = setInterval(() => this.refreshUI(), this._refresh);

this.refreshUI();
}
Expand All @@ -29,4 +30,4 @@ class StatusBarItem {
}
}

module.exports = StatusBarItem;
module.exports = StatusBarItem;
22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
],
"main": "./extension",
"contributes": {
"commands": [{
"command": "clock.insertDateTime",
"title": "Clock: Insert date and time"
}],
"commands": [
{
"command": "clock.insertDateTime",
"title": "Clock: Insert date and time"
}
],
"configuration": {
"type": "object",
"title": "Clock configuration",
Expand All @@ -40,6 +42,11 @@
"type": "string",
"default": "hh:MM TT",
"description": "Clock: Date format according to https://github.com/felixge/node-dateformat"
},
"clock.refreshInterval": {
"type": "number",
"default": 1,
"description": "Refresh interval for clock (set longer to reduce power consumption)"
}
}
}
Expand All @@ -49,5 +56,10 @@
},
"dependencies": {
"dateformat": "^1.0.12"
},
"__metadata": {
"id": "50810048-1465-4380-9716-6cd466f2ef8e",
"publisherDisplayName": "Compulim",
"publisherId": "f9dbfd7c-f9a1-434c-9971-648ad2e23f96"
}
}
}