修改了年份显示的小样式
This commit is contained in:
@@ -13,11 +13,9 @@
|
|||||||
|
|
||||||
<!-- 顶部标题 -->
|
<!-- 顶部标题 -->
|
||||||
<header class="bg-gray-50 dark:bg-gray-800 dark:border-gray-700 p-4 text-center text-xl font-bold">
|
<header class="bg-gray-50 dark:bg-gray-800 dark:border-gray-700 p-4 text-center text-xl font-bold">
|
||||||
分支机构活动管理
|
分支机构活动管理 {{ ''|get_current_year }}年
|
||||||
<br>
|
<br>
|
||||||
{{ ''|get_current_year }}年
|
<small>统计周期:{{ ''|get_statistic_period }}</small>
|
||||||
<br>
|
|
||||||
统计周期:{{ ''|get_statistic_period }}
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- 主体内容:左右两侧栏布局 -->
|
<!-- 主体内容:左右两侧栏布局 -->
|
||||||
|
|||||||
Binary file not shown.
@@ -35,7 +35,11 @@ def get_current_year(value=None):
|
|||||||
"""
|
"""
|
||||||
获取当前年份
|
获取当前年份
|
||||||
"""
|
"""
|
||||||
now = datetime.now() if value is None else value
|
# 只有当value是datetime对象时才使用它,否则使用当前时间
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
now = value
|
||||||
|
else:
|
||||||
|
now = datetime.now()
|
||||||
return now.year
|
return now.year
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +52,11 @@ def get_statistic_period(value=None):
|
|||||||
- 在2026年2月,实际统计的是2025年12月至2026年2月
|
- 在2026年2月,实际统计的是2025年12月至2026年2月
|
||||||
- 以此类推
|
- 以此类推
|
||||||
"""
|
"""
|
||||||
now = datetime.now() if value is None else value
|
# 只有当value是datetime对象时才使用它,否则使用当前时间
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
now = value
|
||||||
|
else:
|
||||||
|
now = datetime.now()
|
||||||
current_year = now.year
|
current_year = now.year
|
||||||
current_month = now.month
|
current_month = now.month
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user