- Install prettier - Configure .prettierrc.json and .prettierignore - Add npm scripts: format, format:check - Add Makefile target: format-frontend - Format all frontend files
22 lines
560 B
TypeScript
22 lines
560 B
TypeScript
/**
|
|
* Date formatting helpers for e2e tests.
|
|
*/
|
|
|
|
/**
|
|
* Format date as YYYY-MM-DD in local timezone.
|
|
*/
|
|
export function formatDateLocal(d: Date): string {
|
|
const year = d.getFullYear();
|
|
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
const day = String(d.getDate()).padStart(2, "0");
|
|
return `${year}-${month}-${day}`;
|
|
}
|
|
|
|
/**
|
|
* Get tomorrow's date string in YYYY-MM-DD format.
|
|
*/
|
|
export function getTomorrowDateStr(): string {
|
|
const tomorrow = new Date();
|
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
return formatDateLocal(tomorrow);
|
|
}
|