chore: change date format
This commit is contained in:
@@ -52,7 +52,7 @@ export async function diaryCommand(
|
|||||||
const formatted = formatResponse(expense);
|
const formatted = formatResponse(expense);
|
||||||
return {
|
return {
|
||||||
success: true,
|
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
|
data: formatted
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ export async function diaryCommand(
|
|||||||
await reporter.sendReport(from, to, includeJson);
|
await reporter.sendReport(from, to, includeJson);
|
||||||
|
|
||||||
const formatDate = (date: Date) =>
|
const formatDate = (date: Date) =>
|
||||||
date.toLocaleDateString('en-US', {
|
date.toLocaleDateString('en-GB', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export async function processDayLog(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: `Added comment to existing log for ${normalizedDate.toLocaleDateString()}`,
|
message: `Added comment to existing log for ${normalizedDate.toLocaleDateString('en-GB')}`,
|
||||||
data: updatedLog
|
data: updatedLog
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@@ -54,7 +54,7 @@ export async function processDayLog(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: `Created new log for ${normalizedDate.toLocaleDateString()}`,
|
message: `Created new log for ${normalizedDate.toLocaleDateString('en-GB')}`,
|
||||||
data: newLog
|
data: newLog
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,14 +114,14 @@ export class ExpenseReporter {
|
|||||||
dayLogs: ReportDayLogsData
|
dayLogs: ReportDayLogsData
|
||||||
): string {
|
): string {
|
||||||
const formatDate = (date: Date) =>
|
const formatDate = (date: Date) =>
|
||||||
date.toLocaleDateString('en-US', {
|
date.toLocaleDateString('en-GB', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
});
|
});
|
||||||
|
|
||||||
const formatCurrency = (amount: number) =>
|
const formatCurrency = (amount: number) =>
|
||||||
amount.toLocaleString('en-US', {
|
amount.toLocaleString('en-GB', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'EUR'
|
currency: 'EUR'
|
||||||
});
|
});
|
||||||
@@ -279,7 +279,7 @@ export class ExpenseReporter {
|
|||||||
const response = await this.resend.emails.send({
|
const response = await this.resend.emails.send({
|
||||||
from: this.senderEmail,
|
from: this.senderEmail,
|
||||||
to: this.recipientEmail,
|
to: this.recipientEmail,
|
||||||
subject: `Diary Report: ${from.toLocaleDateString()} - ${to.toLocaleDateString()}`,
|
subject: `Diary Report: ${from.toLocaleDateString('en-GB')} - ${to.toLocaleDateString('en-GB')}`,
|
||||||
html: htmlContent,
|
html: htmlContent,
|
||||||
attachments
|
attachments
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user