diff --git a/utils/commands/diary.ts b/utils/commands/diary.ts index e1827d7..cd1f1a9 100644 --- a/utils/commands/diary.ts +++ b/utils/commands/diary.ts @@ -52,7 +52,7 @@ export async function diaryCommand( const formatted = formatResponse(expense); return { success: true, - message: `Added expense: ${formatted.description} (${formatted.cost.toFixed(2)}€) in category ${formatted.category} for ${formatted.createdAt.toLocaleDateString()}`, + message: `Added expense: ${formatted.description} (${formatted.cost.toFixed(2)}€) in category ${formatted.category} for ${formatted.createdAt.toLocaleDateString('en-GB')}`, data: formatted }; } @@ -108,7 +108,7 @@ export async function diaryCommand( await reporter.sendReport(from, to, includeJson); const formatDate = (date: Date) => - date.toLocaleDateString('en-US', { + date.toLocaleDateString('en-GB', { year: 'numeric', month: 'long', day: 'numeric' diff --git a/utils/commands/helpers/dayLog.ts b/utils/commands/helpers/dayLog.ts index 678c96d..96f34de 100644 --- a/utils/commands/helpers/dayLog.ts +++ b/utils/commands/helpers/dayLog.ts @@ -41,7 +41,7 @@ export async function processDayLog( return { success: true, - message: `Added comment to existing log for ${normalizedDate.toLocaleDateString()}`, + message: `Added comment to existing log for ${normalizedDate.toLocaleDateString('en-GB')}`, data: updatedLog }; } else { @@ -54,7 +54,7 @@ export async function processDayLog( return { success: true, - message: `Created new log for ${normalizedDate.toLocaleDateString()}`, + message: `Created new log for ${normalizedDate.toLocaleDateString('en-GB')}`, data: newLog }; } diff --git a/utils/commands/report.ts b/utils/commands/report.ts index 7abab64..c4d1b79 100644 --- a/utils/commands/report.ts +++ b/utils/commands/report.ts @@ -114,14 +114,14 @@ export class ExpenseReporter { dayLogs: ReportDayLogsData ): string { const formatDate = (date: Date) => - date.toLocaleDateString('en-US', { + date.toLocaleDateString('en-GB', { year: 'numeric', month: 'long', day: 'numeric' }); const formatCurrency = (amount: number) => - amount.toLocaleString('en-US', { + amount.toLocaleString('en-GB', { style: 'currency', currency: 'EUR' }); @@ -279,7 +279,7 @@ export class ExpenseReporter { const response = await this.resend.emails.send({ from: this.senderEmail, to: this.recipientEmail, - subject: `Diary Report: ${from.toLocaleDateString()} - ${to.toLocaleDateString()}`, + subject: `Diary Report: ${from.toLocaleDateString('en-GB')} - ${to.toLocaleDateString('en-GB')}`, html: htmlContent, attachments });