getFormattedDate
The getFormattedDate function converts a date into a standardized DD.MM.YYYY format using dots as separators.
Syntax
Section titled “Syntax”{date | getFormattedDate}Parameters
Section titled “Parameters”input(string/Date): A date string or Date object to format
Returns
Section titled “Returns”A string in the format DD.MM.YYYY with:
- Two-digit day (padded with zero if needed)
- Two-digit month (padded with zero if needed)
- Four-digit year
- Dots as separators
Examples
Section titled “Examples”Basic formatting
Section titled “Basic formatting”{"2024-01-15" | getFormattedDate}// Returns: "15.01.2024"Single digit days/months
Section titled “Single digit days/months”{"2024-03-05" | getFormattedDate}// Returns: "05.03.2024"End of year
Section titled “End of year”{"2024-12-31" | getFormattedDate}// Returns: "31.12.2024"With timestamp
Section titled “With timestamp”{"2024-07-20T14:30:00Z" | getFormattedDate}// Returns: "20.07.2024"Project dates
Section titled “Project dates”{project.completion_date | getFormattedDate}// Returns formatted completion date with dotsReport metadata
Section titled “Report metadata”{report.generated_at | getFormattedDate}// Returns: "15.01.2024" formatUse Cases
Section titled “Use Cases”- European-style date formatting
- Standardized date display in reports
- File naming with dates
- Audit timestamps
- Document versioning dates
Differences from formatDate
Section titled “Differences from formatDate”While formatDate offers multiple format options, getFormattedDate specifically provides:
- Always returns DD.MM.YYYY format
- Uses dots instead of slashes
- No format parameter needed
- Consistent European date style