feat(ui): antd i18n

This commit is contained in:
Fu Diwei
2024-12-09 16:09:35 +08:00
parent 3b50741f19
commit fdfe54b6da
12 changed files with 138 additions and 67 deletions

View File

@@ -1,4 +1,4 @@
import moment from "moment";
import dayjs from "dayjs";
import { type Access } from "@/domain/access";
import { getPocketBase } from "./pocketbase";
@@ -19,6 +19,6 @@ export const save = async (record: Access) => {
};
export const remove = async (record: Access) => {
record.deleted = moment.utc().format("YYYY-MM-DD HH:mm:ss");
record.deleted = dayjs.utc().format("YYYY-MM-DD HH:mm:ss");
return await getPocketBase().collection("access").update(record.id, record);
};

View File

@@ -1,5 +1,5 @@
import dayjs from "dayjs";
import { type RecordListOptions } from "pocketbase";
import moment from "moment";
import { type Certificate } from "@/domain/certificate";
import { getPocketBase } from "./pocketbase";
@@ -23,7 +23,7 @@ export const list = async (req: CertificateListReq) => {
if (req.state === "expireSoon") {
options.filter = pb.filter("expireAt<{:expiredAt}", {
expiredAt: moment().add(15, "d").toDate(),
expiredAt: dayjs().add(15, "d").toDate(),
});
} else if (req.state === "expired") {
options.filter = pb.filter("expireAt<={:expiredAt}", {