Skip to content

Commit

Permalink
Merge pull request #12 from BarRaider/dev
Browse files Browse the repository at this point in the history
v1.9 - Show seconds on clock
  • Loading branch information
BarRaider committed Jul 7, 2021
2 parents e3ece02 + 00118db commit ec85548
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
14 changes: 12 additions & 2 deletions Sources/com.barraider.worldtime.sdPlugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,19 @@
showDateMMDD = payload['showDateMMDD']
}

let showSeconds = false;
if (payload.hasOwnProperty('showSeconds')) {
showSeconds = payload['showSeconds'];
}

let strSeconds = '';
if (showSeconds) {
strSeconds = (":" + ("0" + offsetTime.getSeconds()).slice(-2));
}

let strTime = '';
if (show24Hours) {
strTime = (("0" + offsetTime.getHours()).slice(-2) + ":" + ("0" + offsetTime.getMinutes()).slice(-2));
strTime = (("0" + offsetTime.getHours()).slice(-2) + ":" + ("0" + offsetTime.getMinutes()).slice(-2) + strSeconds);
}
else if (!hideClock) { // Use AM/PM mode
let hours = offsetTime.getHours();
Expand All @@ -129,7 +139,7 @@
}
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
strTime = (hours + ":" + ("0" + offsetTime.getMinutes()).slice(-2) + ampm);
strTime = (hours + ":" + ("0" + offsetTime.getMinutes()).slice(-2) + strSeconds + ampm);
}
lastTimeCache[context] = strTime; // Used for Copy to clipboard

Expand Down
4 changes: 2 additions & 2 deletions Sources/com.barraider.worldtime.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"PropertyInspectorPath": "worldtime_pi.html",
"Category": "BarRaider",
"CategoryIcon": "categoryIcon",
"Version": "1.8",
"Version": "1.9",
"OS": [
{
"Platform": "mac",
Expand All @@ -37,6 +37,6 @@
}
],
"Software": {
"MinimumVersion": "4.9"
"MinimumVersion": "5.0"
}
}
Binary file modified Sources/com.barraider.worldtime.sdPlugin/pluginIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sources/com.barraider.worldtime.sdPlugin/pluginIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Sources/com.barraider.worldtime.sdPlugin/worldtime_pi.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@
</div>
</div>
</div>
<div type="checkbox" class="sdpi-item" id="dvShowSeconds">
<div class="sdpi-item-label">Show Seconds</div>
<div class="sdpi-item-value">
<input id="showSeconds" class="sdProperty sdCheckbox" type="checkbox" value="" oninput="setSettings()">
<label for="showSeconds" class="sdpi-item-label"><span></span>Show time including seconds</label>
</div>
</div>
<div class="sdpi-item">
</div>
<div type="radio" class="sdpi-item" id="dvDateMode">
Expand Down

0 comments on commit ec85548

Please sign in to comment.