refactor(archive): redesign segmented archive experience

This commit is contained in:
2026-04-14 15:09:25 +02:00
parent 297f63c7d5
commit ab1d8bc677
6 changed files with 1108 additions and 232 deletions
+22
View File
@@ -197,6 +197,17 @@ function format_display_date(string $date, bool $withWeekday = true): string
return $weekdays[(int) $current->format('w')] . ', ' . $label;
}
function format_compact_date(string $date): string
{
$current = DateTimeImmutable::createFromFormat('Y-m-d', $date);
if ($current === false) {
return $date;
}
return $current->format('d.m.Y');
}
function format_display_datetime(string $value): string
{
try {
@@ -223,6 +234,17 @@ function format_display_datetime(string $value): string
return $current->format('j.') . ' ' . $months[(int) $current->format('n')] . ' ' . $current->format('Y') . ' um ' . $current->format('H:i');
}
function format_compact_datetime(string $value): string
{
try {
$current = new DateTimeImmutable($value);
} catch (Throwable) {
return $value;
}
return $current->format('d.m.Y · H:i');
}
function iso_week_key(string $date): string
{
$current = DateTimeImmutable::createFromFormat('Y-m-d', $date);