fix timezone bug

This commit is contained in:
beabigegg
2025-09-21 11:37:39 +08:00
parent a408ce402d
commit 2a0b29402f
22 changed files with 1050 additions and 519 deletions

View File

@@ -47,7 +47,7 @@
<th>建立日期</th>
<th>結束日期</th>
<th class="text-center">剩餘天數</th>
<th>狀態</th>
<th class="text-center">狀態</th>
<th class="text-center">操作</th>
</tr>
</thead>
@@ -57,8 +57,8 @@
<td>{{ spec.spec_code }}</td>
<td>{{ spec.title }}</td>
<td>{{ spec.applicant }}</td>
<td>{{ spec.created_at.strftime('%Y-%m-%d') }}</td>
<td>{{ spec.end_date.strftime('%Y-%m-%d') }}</td>
<td>{{ spec.created_at|taiwan_date }}</td>
<td>{{ spec.end_date|taiwan_date }}</td>
<td class="text-center">
{% if spec.status in ['active', 'expired'] %}
@@ -80,7 +80,7 @@
{% endif %}
</td>
<td>
<td class="text-center">
{% if spec.status == 'active' %}
<span class="badge fs-6 bg-success bg-opacity-75"><i class="bi bi-check-circle-fill me-1"></i>已生效</span>
{% elif spec.status == 'pending_approval' %}
@@ -90,6 +90,18 @@
{% else %}
<span class="badge fs-6 bg-secondary bg-opacity-75"><i class="bi bi-calendar-x-fill me-1"></i>已過期</span>
{% endif %}
{% if spec.extension_count > 0 %}
<br>
<div class="mt-1">
<span class="badge bg-light text-dark border">
<i class="bi bi-arrow-repeat me-1"></i>已展延 {{ spec.extension_count }} 次
</span>
{% if spec.extension_count >= 2 %}
<br><span class="badge bg-danger mt-1">達到上限</span>
{% endif %}
</div>
{% endif %}
</td>
<td class="text-center">
@@ -102,7 +114,11 @@
{% endif %}
{% if current_user.role in ['editor', 'admin'] and spec.status == 'active' %}
<a href="{{ url_for('temp_spec.extend_spec', spec_id=spec.id) }}" class="btn btn-sm btn-secondary" title="展延"><i class="bi bi-calendar-plus"></i></a>
{% if spec.extension_count < 2 %}
<a href="{{ url_for('temp_spec.extend_spec', spec_id=spec.id) }}" class="btn btn-sm btn-secondary" title="展延"><i class="bi bi-calendar-plus"></i></a>
{% else %}
<button class="btn btn-sm btn-secondary" disabled title="已達展延次數上限2次"><i class="bi bi-calendar-x"></i></button>
{% endif %}
<a href="{{ url_for('temp_spec.terminate_spec', spec_id=spec.id) }}" class="btn btn-sm btn-danger" title="終止"><i class="bi bi-x-circle"></i></a>
{% endif %}