forked from git.gladyson/openmonetis
refactor: remover código morto e exports não utilizados
Remove 6 componentes não utilizados (dashboard-grid, expenses/income by category widgets, installment analysis panels, fatura-warning-dialog). Remove funções/tipos não utilizados: successResult, generateApiToken, validateApiToken, getTodayUTC/Local, formatDateForDb, getDateInfo, calculatePercentage, roundToDecimals, safeParseInt/Float, isPeriodValid, getLastPeriods, normalizeWhitespace, formatCurrency wrapper, InboxItemInput, InboxBatchInput, ProcessInboxInput, DiscardInboxInput, LancamentosColumnId, 5 funções de anticipation-helpers. Redireciona imports de formatCurrency para lib/lancamentos/formatting-helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,8 +29,6 @@ export const MONTH_NAMES = [
|
||||
"dezembro",
|
||||
] as const;
|
||||
|
||||
export type MonthName = (typeof MONTH_NAMES)[number];
|
||||
|
||||
// ============================================================================
|
||||
// CORE PARSING & FORMATTING (YYYY-MM format)
|
||||
// ============================================================================
|
||||
@@ -63,20 +61,6 @@ export function formatPeriod(year: number, month: number): string {
|
||||
return `${year}-${String(month).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if period string is valid
|
||||
* @param period - Period string to validate
|
||||
* @returns True if valid, false otherwise
|
||||
*/
|
||||
export function isPeriodValid(period: string): boolean {
|
||||
try {
|
||||
parsePeriod(period);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// PERIOD NAVIGATION
|
||||
// ============================================================================
|
||||
@@ -139,22 +123,6 @@ export function addMonthsToPeriod(period: string, offset: number): string {
|
||||
return formatPeriod(nextYear, nextMonth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last N periods including the current one
|
||||
* @param current - Current period in YYYY-MM format
|
||||
* @param length - Number of periods to return
|
||||
* @returns Array of period strings
|
||||
*/
|
||||
export function getLastPeriods(current: string, length: number): string[] {
|
||||
const periods: string[] = [];
|
||||
|
||||
for (let offset = length - 1; offset >= 0; offset -= 1) {
|
||||
periods.push(addMonthsToPeriod(current, -offset));
|
||||
}
|
||||
|
||||
return periods;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// PERIOD COMPARISON & RANGES
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user