diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index 58f80a3a..fc61c0ca 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -514,3 +514,24 @@ if (! function_exists('audio_player')) { CODE_SAMPLE; } } + +// ------------------------------------------------------------------------ + +if (! function_exists('relative_time')) { + function relative_time(Time $time, string $class = ''): string + { + $translatedDate = lang('Common.mediumDate', [$time]); + $datetime = $time->toDateTimeString(); + + return << + + + CODE_SAMPLE; + } +} + +// ------------------------------------------------------------------------ diff --git a/app/Resources/js/admin.ts b/app/Resources/js/admin.ts index 79f83272..9f9522cb 100644 --- a/app/Resources/js/admin.ts +++ b/app/Resources/js/admin.ts @@ -1,4 +1,5 @@ import "@github/markdown-toolbar-element"; +import "@github/time-elements"; import ClientTimezone from "./modules/ClientTimezone"; import Clipboard from "./modules/Clipboard"; import DateTimePicker from "./modules/DateTimePicker"; diff --git a/app/Resources/js/podcast.ts b/app/Resources/js/podcast.ts index 67235fe7..f3036ec2 100644 --- a/app/Resources/js/podcast.ts +++ b/app/Resources/js/podcast.ts @@ -1,3 +1,4 @@ +import "@github/time-elements"; import Dropdown from "./modules/Dropdown"; import Time from "./modules/Time"; import Toggler from "./modules/Toggler"; diff --git a/app/Views/admin/episode/publish_edit.php b/app/Views/admin/episode/publish_edit.php index d71485dd..8d273db3 100644 --- a/app/Views/admin/episode/publish_edit.php +++ b/app/Views/admin/episode/publish_edit.php @@ -42,12 +42,7 @@ @actor->username ?>

- + published_at, 'text-xs text-gray-500') ?>
@@ -78,13 +73,7 @@ ) ?>
- + published_at) ?>
diff --git a/app/Views/podcast/_partials/reblog.php b/app/Views/podcast/_partials/reblog.php index bcf979ea..2abc307e 100644 --- a/app/Views/podcast/_partials/reblog.php +++ b/app/Views/podcast/_partials/reblog.php @@ -25,11 +25,7 @@ - + published_at) ?> diff --git a/app/Views/podcast/_partials/reblog_authenticated.php b/app/Views/podcast/_partials/reblog_authenticated.php index a4d12387..11c5d301 100644 --- a/app/Views/podcast/_partials/reblog_authenticated.php +++ b/app/Views/podcast/_partials/reblog_authenticated.php @@ -25,11 +25,7 @@ - + published_at) ?> diff --git a/app/Views/podcast/_partials/reply.php b/app/Views/podcast/_partials/reply.php index 8fb48bf8..12977a36 100644 --- a/app/Views/podcast/_partials/reply.php +++ b/app/Views/podcast/_partials/reply.php @@ -11,12 +11,7 @@ ->display_name ?>@actor->username . ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?> - + published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>

message_html ?>

has_preview_card): ?> diff --git a/app/Views/podcast/_partials/reply_authenticated.php b/app/Views/podcast/_partials/reply_authenticated.php index ab264ce5..1d85461c 100644 --- a/app/Views/podcast/_partials/reply_authenticated.php +++ b/app/Views/podcast/_partials/reply_authenticated.php @@ -11,12 +11,7 @@ ->display_name ?>@actor->username . ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?> - + published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>

message_html ?>

has_preview_card): ?> diff --git a/app/Views/podcast/_partials/status.php b/app/Views/podcast/_partials/status.php index 9d3b0f18..21d3d080 100644 --- a/app/Views/podcast/_partials/status.php +++ b/app/Views/podcast/_partials/status.php @@ -18,11 +18,7 @@ - + published_at) ?> diff --git a/app/Views/podcast/_partials/status_authenticated.php b/app/Views/podcast/_partials/status_authenticated.php index 3a1771c9..143be143 100644 --- a/app/Views/podcast/_partials/status_authenticated.php +++ b/app/Views/podcast/_partials/status_authenticated.php @@ -18,11 +18,7 @@ - + published_at) ?> diff --git a/app/Views/podcast/episode.php b/app/Views/podcast/episode.php index 834de56a..5d7fb555 100644 --- a/app/Views/podcast/episode.php +++ b/app/Views/podcast/episode.php @@ -59,13 +59,7 @@ 'text-gray-700', ) ?>
- + published_at) ?>