diff --git a/src/services/command.ts b/src/services/command.ts index f00ed9b..20980b8 100644 --- a/src/services/command.ts +++ b/src/services/command.ts @@ -13,7 +13,7 @@ import { Metrics } from './metrics'; import { ResponseQueue } from './response-queue'; import { randomTokenBase64Url, sha256Hex } from '../utils/crypto'; import { route as routeCommand } from './commands'; -import { ACTION_ALIASES, SCOPE_ALIASES } from './commands/shared'; +import { ACTION_ALIASES, SCOPE_ALIASES, todayYMD as todayYMD_TZ } from './commands/shared'; import { parseNueva } from './commands/parsers/nueva'; type CommandContext = { @@ -71,18 +71,7 @@ export class CommandService { // Usar formatDDMM desde utils/formatting // TZ y "hoy" en TZ para marcar vencidas en listados - const TZ = process.env.TZ && process.env.TZ.trim() ? process.env.TZ : 'Europe/Madrid'; - const ymdInTZ = (d: Date): string => { - const parts = new Intl.DateTimeFormat('en-GB', { - timeZone: TZ, - year: 'numeric', - month: '2-digit', - day: '2-digit', - }).formatToParts(d); - const get = (t: string) => parts.find(p => p.type === t)?.value || ''; - return `${get('year')}-${get('month')}-${get('day')}`; - }; - const todayYMD = ymdInTZ(new Date()); + const todayYMD = todayYMD_TZ(); if (!action || action === 'ayuda') { const feature = String(process.env.FEATURE_HELP_V2 ?? 'true').toLowerCase();