初始化:质量数据分析平台源码

This commit is contained in:
2026-10-22 15:58:57 +08:00
commit 1e8a655adc
280 changed files with 43922 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
export function previousCompleteMonth(reference = new Date()): { year: number; month: number } {
const previous = new Date(reference.getFullYear(), reference.getMonth() - 1, 1);
return { year: previous.getFullYear(), month: previous.getMonth() + 1 };
}
export function previousCompleteQuarter(reference = new Date()): { year: number; quarter: number } {
const firstMonthOfCurrentQuarter = Math.floor(reference.getMonth() / 3) * 3;
const previousQuarterEnd = new Date(reference.getFullYear(), firstMonthOfCurrentQuarter, 0);
return { year: previousQuarterEnd.getFullYear(), quarter: Math.floor(previousQuarterEnd.getMonth() / 3) + 1 };
}