File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ <h1>California Clock Change</h1>
104104 < div id ="past-change "> </ div >
105105 < div id ="future-change "> </ div >
106106 < div id ="body-clock "> </ div >
107+ < div id ="current-dst "> </ div >
107108 </ div >
108109
109110 < script >
@@ -241,6 +242,15 @@ <h1>California Clock Change</h1>
241242
242243 // Update body clock info based on past change
243244 updateBodyClockInfo ( pastChange ) ;
245+
246+ // Determine if it is currently daylight savings time or not
247+ const currentDstDiv = document . getElementById ( 'current-dst' ) ;
248+ const isDst = pastChange . isSpringForward && futureChange . isSpringForward ;
249+ currentDstDiv . className = 'info-box' ;
250+ currentDstDiv . innerHTML = `
251+ <div>Current status:</div>
252+ It is currently <span class="highlight">${ isDst ? 'Daylight Saving Time (PDT)' : 'Standard Time (PST)' } </span>.
253+ ` ;
244254 }
245255
246256 updateInfo ( ) ;
You can’t perform that action at this time.
0 commit comments