From 3b5ec28658b3f9e8f3b8fc0f1d2c564c8b58f08e Mon Sep 17 00:00:00 2001 From: Lynn Trickey Date: Fri, 19 May 2017 15:22:25 -0700 Subject: [PATCH 1/4] Added JQuery link --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 191d3cc..d1aaa5a 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,12 @@
+ + + + - - From dc2ee3bca4e2974c47a2c2385b43ac03f9cdc24a Mon Sep 17 00:00:00 2001 From: Lynn Trickey Date: Fri, 19 May 2017 15:29:30 -0700 Subject: [PATCH 2/4] Created new date object, parsed out hours and minutes to display --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 877a3aa..e24c3d1 100644 --- a/index.js +++ b/index.js @@ -1 +1,7 @@ // Your code here +$(document).ready(function() { + var time = new Date(Date.now()); + var hours = time.getHours(); + var minutes = time.getMinutes(); + $("#clock").append('

' + hours + ':' + minutes + '

'); +}); From 3ddf1386123bdcbd5d756ebfd053a213d9caa4aa Mon Sep 17 00:00:00 2001 From: Lynn Trickey Date: Fri, 19 May 2017 15:52:47 -0700 Subject: [PATCH 3/4] Got set interval and displayWIth working --- index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index e24c3d1..879ca34 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,13 @@ // Your code here $(document).ready(function() { - var time = new Date(Date.now()); - var hours = time.getHours(); - var minutes = time.getMinutes(); - $("#clock").append('

' + hours + ':' + minutes + '

'); + var startTime = new Date(Date.now()).toLocaleTimeString(); + $("#clock").append('

' + startTime + '

'); + + var displayTime = function () { + var nowTime = new Date(Date.now()).toLocaleTimeString(); + $('p').replaceWith('

' + nowTime + '

'); + }; + + var changeTime = setInterval(displayTime, 1000); + }); From ff49e0759e65b11154c9b06ebd65cf444ed58576 Mon Sep 17 00:00:00 2001 From: Lynn Trickey Date: Sun, 21 May 2017 21:20:34 -0700 Subject: [PATCH 4/4] Adding to submit --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d1aaa5a..33d5066 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,9 @@ -
- +
+

Local Time:

+