Commit 4a8510389038f17f7515bf3b41b26c464b8de668
1 parent
49c45fd8
fix: real time component date not change
Showing
1 changed file
with
5 additions
and
0 deletions
... | ... | @@ -119,10 +119,15 @@ |
119 | 119 | function initRealTimeComponent() { |
120 | 120 | RAFSetInterval(() => { |
121 | 121 | const allTimeNode = document.querySelectorAll('.thingKit-component__real-time .real-time__now') |
122 | + const allDateNode = document.querySelectorAll('.thingKit-component__real-time .real-time__date') | |
122 | 123 | for (const time of allTimeNode) { |
123 | 124 | const date = new Date() |
124 | 125 | time.innerHTML = `${date.getHours() < 10 ? '0' : ''}${date.getHours()}:${date.getMinutes() < 10 ? '0' : ''}${date.getMinutes()}:${date.getSeconds() < 10 ? '0' : ''}${date.getSeconds()}` |
125 | 126 | } |
127 | + | |
128 | + for (const date of allDateNode) { | |
129 | + date.innerHTML = getCurrentDate() | |
130 | + } | |
126 | 131 | }, 1000) |
127 | 132 | } |
128 | 133 | ... | ... |