mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
fix: pass timezone to relative time component to show the localized time in the UI
This commit is contained in:
parent
abb7fbac27
commit
b9db936461
@ -383,7 +383,7 @@ if (! function_exists('relative_time')) {
|
|||||||
function relative_time(Time $time, string $class = ''): string
|
function relative_time(Time $time, string $class = ''): string
|
||||||
{
|
{
|
||||||
$translatedDate = lang('Common.mediumDate', [$time]);
|
$translatedDate = lang('Common.mediumDate', [$time]);
|
||||||
$datetime = $time->toDateTimeString();
|
$datetime = $time->format(DateTime::ISO8601);
|
||||||
|
|
||||||
return <<<CODE_SAMPLE
|
return <<<CODE_SAMPLE
|
||||||
<time-ago class="{$class}" datetime="{$datetime}">
|
<time-ago class="{$class}" datetime="{$datetime}">
|
||||||
|
@ -73,17 +73,11 @@
|
|||||||
<legend class="text-lg font-semibold"><?= lang(
|
<legend class="text-lg font-semibold"><?= lang(
|
||||||
'Episode.publish_form.publication_date',
|
'Episode.publish_form.publication_date',
|
||||||
) ?></legend>
|
) ?></legend>
|
||||||
<Forms.Radio id="now" name="publication_method" isChecked="<?= old('publication_method') ? old('publish') === 'now' : true ?>"><?= lang('Episode.publish_form.publication_method.now') ?></Forms.Radio>
|
<Forms.Radio value="now" name="publication_method" isChecked="<?= old('publication_method') ? old('publish') === 'now' : true ?>"><?= lang('Episode.publish_form.publication_method.now') ?></Forms.Radio>
|
||||||
<div class="inline-flex flex-wrap items-center radio-toggler">
|
<div class="inline-flex flex-wrap items-center radio-toggler">
|
||||||
<?= form_radio(
|
<input
|
||||||
[
|
class="w-6 h-6 border-black text-pine-500 border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100"
|
||||||
'id' => 'schedule',
|
type="radio" id="schedule" name="publication_method" value="schedule" <?= old('publication_method') && old('publication_method') === 'schedule' ? 'checked' : '' ?> />
|
||||||
'name' => 'publication_method',
|
|
||||||
'class' => 'text-pine-500 border-black border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 w-6 h-6',
|
|
||||||
],
|
|
||||||
'schedule',
|
|
||||||
old('publication_method') && old('publication_method') === 'schedule',
|
|
||||||
) ?>
|
|
||||||
<Label for="schedule" class="pl-2 leading-8"><?= lang('Episode.publish_form.publication_method.schedule') ?></label>
|
<Label for="schedule" class="pl-2 leading-8"><?= lang('Episode.publish_form.publication_method.schedule') ?></label>
|
||||||
<div class="w-full mt-2 radio-toggler-element">
|
<div class="w-full mt-2 radio-toggler-element">
|
||||||
<Forms.Field
|
<Forms.Field
|
||||||
|
@ -77,17 +77,11 @@
|
|||||||
<legend class="text-lg font-semibold"><?= lang(
|
<legend class="text-lg font-semibold"><?= lang(
|
||||||
'Episode.publish_form.publication_date',
|
'Episode.publish_form.publication_date',
|
||||||
) ?></legend>
|
) ?></legend>
|
||||||
<Forms.Radio id="now" name="publication_method" isChecked="<?= old('publication_method') && old('publish') === 'now' ?>"><?= lang('Episode.publish_form.publication_method.now') ?></Forms.Radio>
|
<Forms.Radio value="now" name="publication_method" isChecked="<?= old('publication_method') && old('publish') === 'now' ?>"><?= lang('Episode.publish_form.publication_method.now') ?></Forms.Radio>
|
||||||
<div class="inline-flex flex-wrap items-center radio-toggler">
|
<div class="inline-flex flex-wrap items-center radio-toggler">
|
||||||
<?= form_radio(
|
<input
|
||||||
[
|
class="w-6 h-6 border-black text-pine-500 border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100"
|
||||||
'id' => 'schedule',
|
type="radio" id="schedule" name="publication_method" value="schedule" <?= old('publication_method') ? old('publication_method') === 'schedule' : 'checked' ?> />
|
||||||
'name' => 'publication_method',
|
|
||||||
'class' => 'text-pine-500 border-black border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 w-6 h-6',
|
|
||||||
],
|
|
||||||
'schedule',
|
|
||||||
old('publication_method') ? old('publication_method') === 'schedule' : true,
|
|
||||||
) ?>
|
|
||||||
<Label for="schedule" class="pl-2 leading-8"><?= lang('Episode.publish_form.publication_method.schedule') ?></label>
|
<Label for="schedule" class="pl-2 leading-8"><?= lang('Episode.publish_form.publication_method.schedule') ?></label>
|
||||||
<div class="w-full mt-2 radio-toggler-element">
|
<div class="w-full mt-2 radio-toggler-element">
|
||||||
<Forms.Field
|
<Forms.Field
|
||||||
|
Loading…
x
Reference in New Issue
Block a user