fix: update recent transactions badge styling and localize time formatting
- Added padding to the "Rückerstattet" badge for improved visual appearance. - Updated time formatting in the formatRelativeTime function to use German language strings for better localization.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Formatiert einen Timestamp als relative Zeitangabe.
|
||||
* Beispiele: "Just now", "5m ago", "3h ago", "2d ago", "12. Mär"
|
||||
* Beispiele: "Gerade eben", "vor 5 Min.", "vor 3 Std.", "vor 2 Tagen", "12. Mär"
|
||||
*/
|
||||
export function formatRelativeTime(timestamp: number): string {
|
||||
const now = Date.now();
|
||||
@@ -9,10 +9,10 @@ export function formatRelativeTime(timestamp: number): string {
|
||||
const hours = Math.floor(diff / 3600000);
|
||||
const days = Math.floor(diff / 86400000);
|
||||
|
||||
if (minutes < 1) return "Just now";
|
||||
if (minutes < 60) return `${minutes}m ago`;
|
||||
if (hours < 24) return `${hours}h ago`;
|
||||
if (days < 7) return `${days}d ago`;
|
||||
if (minutes < 1) return "Gerade eben";
|
||||
if (minutes < 60) return `vor ${minutes} Min.`;
|
||||
if (hours < 24) return `vor ${hours} Std.`;
|
||||
if (days < 7) return days === 1 ? "vor 1 Tag" : `vor ${days} Tagen`;
|
||||
return new Date(timestamp).toLocaleDateString("de-DE", {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
|
||||
Reference in New Issue
Block a user