deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+3
View File
@@ -0,0 +1,3 @@
import type { DateLibOptions } from "../../classes/DateLib.js";
/** Format override adding +543 to year tokens for Buddhist Era (BE). */
export declare function format(date: Date, formatStr: string, options?: DateLibOptions): string;
+30
View File
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.format = format;
const date_fns_1 = require("date-fns");
/** Format override adding +543 to year tokens for Buddhist Era (BE). */
function format(date, formatStr, options) {
const beYear = date.getFullYear() + 543;
switch (formatStr) {
case "LLLL y":
case "LLLL yyyy":
return `${(0, date_fns_1.format)(date, "LLLL", options)} ${beYear}`;
case "LLLL":
return (0, date_fns_1.format)(date, "LLLL", options);
case "yyyy":
return String(beYear).padStart(4, "0");
case "y":
return String(beYear);
case "yyyy-MM":
return `${beYear}-${(0, date_fns_1.format)(date, "MM", options)}`;
case "yyyy-MM-dd":
return `${beYear}-${(0, date_fns_1.format)(date, "MM", options)}-${(0, date_fns_1.format)(date, "dd", options)}`;
case "PPP":
case "PPPP": {
const raw = (0, date_fns_1.format)(date, formatStr, options);
return raw.replace(/(.*)(\d{4})(?!.*\d)/, (_m, pre) => `${pre}${beYear}`);
}
default:
return (0, date_fns_1.format)(date, formatStr, options);
}
}