feat(web): 请求时间改为 ISO8601+08:00 偏移,响应仍为 Unix 秒

This commit is contained in:
2026-10-08 14:12:07 +08:00
parent 8b54629159
commit b33fc64a28
6 changed files with 79 additions and 29 deletions
+5 -5
View File
@@ -17,7 +17,7 @@ import {
type RangeValue,
} from "@/composables/use-live-time-range.ts";
import { useAdminOverview, useEngine, usePayments } from "@/queries/admin.ts";
import { formatMinute } from "@/utils/time.ts";
import { formatMinute, toRequestIso } from "@/utils/time.ts";
import { formatInt } from "@/utils/format.ts";
const router = useRouter();
@@ -40,10 +40,10 @@ const extraPresets = computed(() => {
.filter((p) => p.kind === "subscription" && p.period_start != null)
.map((p) => ({
label: `订阅 #${p.subscription_id ?? p.id} 期间`,
from: new Date((p.period_start ?? 0) * 1000).toISOString(),
to: new Date(
(p.period_end ?? Math.floor(Date.now() / 1000)) * 1000,
).toISOString(),
from: toRequestIso(new Date((p.period_start ?? 0) * 1000)),
to: toRequestIso(
new Date((p.period_end ?? Math.floor(Date.now() / 1000)) * 1000),
),
}))
.slice(0, 4);
});