update tarot frame settings UI

This commit is contained in:
2026-04-01 16:08:52 -07:00
parent a7d956cee8
commit efe5017740
7 changed files with 1216 additions and 67 deletions

View File

@@ -29,7 +29,8 @@
suitInfo: hasDb && db.suitInfo && typeof db.suitInfo === "object" ? db.suitInfo : suitInfo,
rankInfo: hasDb && db.rankInfo && typeof db.rankInfo === "object" ? db.rankInfo : rankInfo,
courtInfo: hasDb && db.courtInfo && typeof db.courtInfo === "object" ? db.courtInfo : courtInfo,
courtDecanWindows: hasDb && db.courtDecanWindows && typeof db.courtDecanWindows === "object" ? db.courtDecanWindows : courtDecanWindows
courtDecanWindows: hasDb && db.courtDecanWindows && typeof db.courtDecanWindows === "object" ? db.courtDecanWindows : courtDecanWindows,
courtDateRanges: hasDb && db.courtDateRanges && typeof db.courtDateRanges === "object" ? db.courtDateRanges : {}
};
}
@@ -178,7 +179,36 @@
return { start, end };
}
function buildDecanDateRange(sign, decanIndex) {
function buildTokenDateRange(startToken, endToken) {
const start = monthDayToDate(startToken, 2025);
const endBase = monthDayToDate(endToken, 2025);
if (!start || !endBase) {
return null;
}
const wraps = endBase.getTime() < start.getTime();
const end = wraps ? monthDayToDate(endToken, 2026) : endBase;
if (!end) {
return null;
}
return {
start,
end,
startMonth: start.getMonth() + 1,
endMonth: end.getMonth() + 1,
startToken: formatMonthDayToken(start),
endToken: formatMonthDayToken(end),
label: `${formatMonthDayLabel(start)}${formatMonthDayLabel(end)}`
};
}
function buildDecanDateRange(sign, decanIndex, decan = null) {
const explicitRange = buildTokenDateRange(decan?.dateStart, decan?.dateEnd);
if (explicitRange) {
return explicitRange;
}
const bounds = getSignDateBounds(sign);
if (!bounds || !Number.isFinite(Number(decanIndex))) {
return null;
@@ -238,7 +268,7 @@
const startDegree = (index - 1) * 10;
const endDegree = startDegree + 10;
const dateRange = buildDecanDateRange(sign, index);
const dateRange = buildDecanDateRange(sign, index, decan);
return {
decan,