Lee Morgan 6 месяцев назад
Родитель
Сommit
8dd341e0f4
2 измененных файлов с 2 добавлено и 1 удалено
  1. 0 0
      index.html
  2. 2 1
      index.js

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
index.html


+ 2 - 1
index.js

@@ -18,7 +18,8 @@ const renderForecast = (f)=>{
     const tbody = document.getElementById("forecastBody");
     const tbody = document.getElementById("forecastBody");
 
 
     for(let i = 0; i < f.length; i++){
     for(let i = 0; i < f.length; i++){
-        let date = new Date(f[i].date);
+        const [y, m, d] = f[i].date.split("-").map(Number);
+        const date = new Date(y, m-1, d);
         head.children[i+1].textContent = date.toLocaleDateString("en-US", {
         head.children[i+1].textContent = date.toLocaleDateString("en-US", {
             month: "short",
             month: "short",
             day: "numeric",
             day: "numeric",

Некоторые файлы не были показаны из-за большого количества измененных файлов