Skip to content

Commit

Permalink
Clock Widget: Adjust formatting & print full hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Friedrich committed Oct 8, 2019
1 parent 6319e21 commit 1e344ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions widgets/clock/clock.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ class Dashing.Clock extends Dashing.Widget

startTime: =>
zone = @get('timezone')
optionsDate = { timeZone: zone, weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' };
optionsTime = { timeZone: zone, hour: '2-digit', minute: '2-digit'};
optionsDate = {
timeZone: zone,
weekday: 'short',
year: 'numeric',
month: 'short',
day: 'numeric'
};
optionsTime = {
timeZone: zone,
hour: '2-digit',
minute: '2-digit',
hour12: false
};

date = new Date().toLocaleDateString('en-US', optionsDate);
time = new Date().toLocaleTimeString('en-US', optionsTime);
Expand Down
2 changes: 1 addition & 1 deletion widgets/clock/clock.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h1 data-bind="title"></h1>
<h3 data-bind="date"></h3>
<h2 style="font-size:4em;" data-bind="time"></h2>
<h2 data-bind="time"></h2>

0 comments on commit 1e344ed

Please sign in to comment.