Updated the logic to write minutes.
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
<body>
|
||||
<div id="main" class="main">
|
||||
<div id="message">
|
||||
<h1 id="message-text">Hey Deepjyoti, Good Morning!</h1>
|
||||
<h1 id="message-text">Good Morning!</h1>
|
||||
</div>
|
||||
<div id="date">
|
||||
<h2 id="date-text">13 May, 11:30</h2>
|
||||
<h2 id="date-text"></h2>
|
||||
</div>
|
||||
<div id="search-bar">
|
||||
<input id="search-bar-input" placeholder="Search something on Google"></input>
|
||||
|
||||
@@ -93,7 +93,8 @@ function updateTime() {
|
||||
currentDate = new Date()
|
||||
date = currentDate.getDate()
|
||||
month = dateMap[currentDate.getMonth()]
|
||||
time = currentDate.getHours() + ":" + currentDate.getMinutes()
|
||||
minutes = currentDate.getMinutes()
|
||||
time = currentDate.getHours() + ":" + (minutes < 10 ? "0" + minutes : minutes)
|
||||
finalDate = date + " " + month + ", " + time
|
||||
document.getElementById(dateId).textContent = finalDate
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user