deploy: v0.12 存档迁移+考古日志滚动条

This commit is contained in:
2026-06-24 03:04:38 +00:00
parent 4831505ef9
commit b4c6111516
58986 changed files with 7569452 additions and 31667 deletions
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setYear = setYear;
const daysInMonth_js_1 = require("../utils/daysInMonth.js");
const index_js_1 = require("../utils/index.js");
/**
* Set year
*
* @param {Date} date - The original date
* @param {number} year - The year to set
* @returns {Date} The new date with the year set
*/
function setYear(date, year) {
const { month, day } = (0, index_js_1.toEthiopicDate)(date);
// Check if the day is valid in the new year (handles leap year changes)
const maxDays = (0, daysInMonth_js_1.daysInMonth)(month, year);
const newDay = Math.min(day, maxDays);
return (0, index_js_1.toGregorianDate)({ year, month, day: newDay });
}