laiguoran 3 年 前
コミット
e6b462cee7
1 ファイル変更5 行追加5 行削除
  1. 5 5
      app/view/tender/detail.ejs

+ 5 - 5
app/view/tender/detail.ejs

@@ -1175,7 +1175,7 @@
                         if (index === 0) {
                             historyHTML += `<li class="timeline-list-item pb-2">
                             <div class="timeline-item-date">
-                                ${formatDate(auditor.begin_time)}
+                                ${formatDate(auditor.begin_time, !dayMode)}
                             </div>
                             <div class="timeline-item-tail"></div>
                             <div class="timeline-item-icon bg-success text-light">
@@ -1197,7 +1197,7 @@
                         </li>
                         <li class="timeline-list-item pb-2">
                             <div class="timeline-item-date">
-                                ${formatDate(auditor.end_time)}
+                                ${formatDate(auditor.end_time, !dayMode)}
                             </div>`
 
                             if(index < auditors.length - 1) {
@@ -1239,7 +1239,7 @@
                         } else {
                             historyHTML += `<li class="timeline-list-item pb-2">
                         <div class="timeline-item-date">
-                            ${formatDate(auditor.end_time)}
+                            ${formatDate(auditor.end_time, !dayMode)}
                         </div>`
 
                             if(index < auditors.length - 1) {
@@ -1313,7 +1313,7 @@
             }
         });
 
-        function formatDate(date) {
+        function formatDate(date, dayMode) {
             if (!date) return '';
             date = new Date(date)
             const year = date.getFullYear();
@@ -1337,7 +1337,7 @@
             if (scond < 10) {
                 scond = '0' + scond.toString();
             }
-            return `${year}<span class="text-light">${mon}-${day}</span><span class="text-light">${hour}:${minute}:${scond}</span>`;
+            return `${year}<span class="${dayMode ? 'text-light' : ''}">${mon}-${day}</span><span class="${dayMode ? 'text-light' : ''}">${hour}:${minute}:${scond}</span>`;
         };
     })
 </script>