chore: change date format

This commit is contained in:
Riccardo Senica
2025-01-25 10:17:57 +00:00
parent cdef3ec86a
commit c3dae18818
3 changed files with 7 additions and 7 deletions

View File

@@ -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'

View File

@@ -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
};
}

View File

@@ -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
});