|
|
|
@ -13,7 +13,7 @@ import { Metrics } from './metrics';
|
|
|
|
import { ResponseQueue } from './response-queue';
|
|
|
|
import { ResponseQueue } from './response-queue';
|
|
|
|
import { randomTokenBase64Url, sha256Hex } from '../utils/crypto';
|
|
|
|
import { randomTokenBase64Url, sha256Hex } from '../utils/crypto';
|
|
|
|
import { route as routeCommand } from './commands';
|
|
|
|
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';
|
|
|
|
import { parseNueva } from './commands/parsers/nueva';
|
|
|
|
|
|
|
|
|
|
|
|
type CommandContext = {
|
|
|
|
type CommandContext = {
|
|
|
|
@ -71,18 +71,7 @@ export class CommandService {
|
|
|
|
// Usar formatDDMM desde utils/formatting
|
|
|
|
// Usar formatDDMM desde utils/formatting
|
|
|
|
|
|
|
|
|
|
|
|
// TZ y "hoy" en TZ para marcar vencidas en listados
|
|
|
|
// 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 todayYMD = todayYMD_TZ();
|
|
|
|
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());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!action || action === 'ayuda') {
|
|
|
|
if (!action || action === 'ayuda') {
|
|
|
|
const feature = String(process.env.FEATURE_HELP_V2 ?? 'true').toLowerCase();
|
|
|
|
const feature = String(process.env.FEATURE_HELP_V2 ?? 'true').toLowerCase();
|
|
|
|
|