|
|
@@ -119,6 +119,7 @@ import {
|
|
|
submitPunch,
|
|
|
} from "@/api/attendance";
|
|
|
import { getLocationWithFallback } from "@/utils/location";
|
|
|
+import { extractTime } from "@/utils/format";
|
|
|
|
|
|
const pendingCount = ref(0);
|
|
|
const currentUser = useCurrentUser();
|
|
|
@@ -175,14 +176,6 @@ const shiftText = computed(() => {
|
|
|
return `${name} · ${extractTime(start)} - ${extractTime(end)}`;
|
|
|
});
|
|
|
|
|
|
-// 后端返回的班次时间是 "2026-09-14 09:00:00" / ISO 等带日期的字符串,
|
|
|
-// 这里只展示 HH:MM,避免 2026-09-14 这种信息污染卡片
|
|
|
-function extractTime(value) {
|
|
|
- if (value == null || value === "") return "";
|
|
|
- const m = String(value).match(/(\d{1,2}:\d{2})(:\d{2})?/);
|
|
|
- return m ? m[1] : String(value);
|
|
|
-}
|
|
|
-
|
|
|
// 把 "18:00:00" / "2026-09-14 18:00:00" 这种班次时间解析为"今日该时刻"的 Date
|
|
|
function parseShiftTime(value) {
|
|
|
if (value == null || value === "") return null;
|